streamich/react-use

useDebounce and cancellation

Open

#401 opened on 2019年6月18日

GitHub で見る
 (5 comments) (6 reactions) (0 assignees)TypeScript (3,273 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (43,979 stars)
PR merge metrics
 (平均マージ 1743d 9h) (30d で 1 merged PR)

説明

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.

コントリビューターガイド