0.0.1 • Published 6 years ago
dampen v0.0.1
dampen
Debounce any redux action-creator.
const dampen = require('dampen')
const update = dampen(250, payload =>
({ type: 'UPDATE', payload })
)
// elsewhere...
dispatch(update('one'))
dispatch(update('two'))
dispatch(update('three'))
// only { type: 'UPDATE', payload: 'three' }
// will be dispatched after 250ms
Requires redux-thunk
or native support for thunks to function properly.
0.0.1
6 years ago