streamich/react-use

useDebounce and cancellation

Ouverte

#401 ouverte le 18 juin 2019

 (5 commentaires) (6 réactions) (0 personne assignée)TypeScript (3 273 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (43 979 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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.

Guide contributeur