streamich/react-use

useDebounce and cancellation

Aperta

#401 aperta il 18 giu 2019

 (5 commenti) (6 reazioni) (0 assegnatari)TypeScript (3273 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (43.979 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor