Throttle Action
Create throttled redux-thunk actions. Throttled actions can be dispatched at most once per every wait
milliseconds.
Installation
npm i --save throttle-action
Usage
; const INCREMENT_COUNTER = 'INCREMENT_COUNTER'; { return type: INCREMENT_COUNTER ;} { return { ; };} // wrap normal actions with throttleAction() to create throttled actionsconst incrementThrottled = ;const incrementThunkThrottled = ; // call throttled actions like normal redux actions;;; const store = ; store;// --> INCREMENT_COUNTER dispatched immediatelystore;// --> INCREMENT_COUNTER dispatched again after one second store;// --> INCREMENT_COUNTER dispatched immediatelystore;store;// --> nothing dispatched
Uses lodash's throttle
.
License
MIT