actions-debouncer
v1.0.4
Published
Debounce actions to ensure it will be processed only once.
Readme
Actions debouncer
This package attempts to debounce actions to ensure that only one will be excecuted in a defined timeout
Intallation
npm i actions-debouncerUsage
const Debouncer = require('actions-debouncer')
const debouncer = new Debouncer( (value) => console.log(value) )
debouncer.do(1)
debouncer.do(2)
debouncer.do(3)
// Output: 3Counstructor:
- action: Closure. Receives the parameter sent to the do method
- options: Object:
- timeout: time in milisencods which it will debounce actions. Default
300ms.
- timeout: time in milisencods which it will debounce actions. Default
