streamich/react-use

useDebounce and cancellation

Open

#401 geöffnet am 18. Juni 2019

Auf GitHub ansehen
 (5 Kommentare) (6 Reaktionen) (0 zugewiesene Personen)TypeScript (43.979 Stars) (3.273 Forks)batch import
enhancementhelp wanted

Beschreibung

Similar to how debounce does it, the hook should return callbacks to clear and flush. This is important for scenarios, where some other action has immediate priority and debounce, should be silenced in that case. The typical is having debounced submit of form input but be able to just hit Enter to speed up the action.

Personally, I haven't used flush operation anywhere yet and cannot imagine some practical use case for it.

Contributor Guide