double-bucket
v1.0.3
Published
A wrapper of double event handler
Downloads
4
Readme
Double Bucket
A wrapper of double event handler
Install
npm install --save double-bucket
Usage
React.js example
import DoubleBucket from 'double-bucket';
export default function DemoComponent() {
const singleCb = () => console.log('on singleCb');
const doubleCb = () => console.log('on doubleCb');
const bucket = new DoubleBucket(singleCb, doubleCb, {
debounceTimeMs: 300, // optional, default value is 300 ms
});
return (<button onClick={bucket.wrap}>Demo Button</button>);
}
License
MIT