0.0.1 • Published 6 years ago

dampen v0.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

dampen

npm version npm downloads Build Status Coverage Status

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.