Les Szklanny

Results 15 comments of Les Szklanny

You probably don't want to memoize the AbortController. You can only abort a controller instance once, so a new request requires a new controller.

@strothj The issue is not whether the AbortController instance is properly cached or not. The abort controller should not be cached at all.

>>> Async selectors need to be "pure", that is always return the same results for a given set of input dependency values. I think the proper word in this context...

Read this: https://github.com/facebook/react/issues/15156

https://github.com/jamiebuilds/unstated-next/issues/10

> I'm just failing to understand why use unstated. The implementation looking at the source doesn't seem to do anything to add to the existing context API, no memoized selectors,...

Thanks, but how would I abort the request when the component unmounts?

> I'm not also 100% sure if we can re-use AbortController AbortController can't be reused or reset. Thanks for taking time to answer my question. This Recoil issue is still...

How do I cancel debounce cycle?

See lodash [debounce](https://www.geeksforgeeks.org/lodash-_-debounce-method/) They use an option named `wait`, it reads better imo than `delayMilliseconds`. The [useDebounce](https://github.com/xnimorz/use-debounce) hook was mimicked after lodash. The author of this hook was the first...