streamich/react-use

useDebounce and cancellation

開放

#401 建立於 2019年6月18日

 (5 則留言) (6 個反應) (0 位負責人)TypeScript (3,273 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (43,979 顆星)
PR 合併指標
 (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.

貢獻者指南