https://github.com/articulate/dampen
Debounce any redux action-creator
https://github.com/articulate/dampen
action action-creator debounce redux
Last synced: 3 months ago
JSON representation
Debounce any redux action-creator
- Host: GitHub
- URL: https://github.com/articulate/dampen
- Owner: articulate
- License: mit
- Created: 2018-08-10T04:30:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-04T17:18:10.000Z (over 2 years ago)
- Last Synced: 2025-10-05T00:32:53.241Z (10 months ago)
- Topics: action, action-creator, debounce, redux
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 54
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dampen
[](https://www.npmjs.com/package/dampen)
[](https://www.npmjs.com/package/dampen)
[](https://travis-ci.org/articulate/dampen)
[](https://coveralls.io/github/articulate/dampen?branch=master)
Debounce any redux action-creator.
```js
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`](https://github.com/reduxjs/redux-thunk) or [native support for thunks](https://github.com/flintinatux/puddles) to function properly.