Debounce Action
Create debounced redux-thunk actions. Debounced actions will delay being dispatched until after wait
milliseconds have elapsed since the last time the debounced action was dispatched.
Installation
npm i --save debounce-action
Usage
; const INCREMENT_COUNTER = 'INCREMENT_COUNTER'; { return type: INCREMENT_COUNTER ;} { return { ; };} // wrap normal actions with debounceAction() to create debounced actionsconst incrementDebounced = ;const incrementThunkDebounced = ; // call debounced actions like normal redux actions;;; const store = ; store;store;// --> INCREMENT_COUNTER dispatched once after one second store;// --> INCREMENT_COUNTER dispatched immediatelystore;store;// --> INCREMENT_COUNTER dispatched once again after five seconds
Uses lodash's debounce
.
License
MIT