@renovator/counter
v1.0.0
Published
```js import { CountdownTimer } from '@renovator/counter';
Downloads
3
Readme
@renovator/counter
import { CountdownTimer } from '@renovator/counter';
const timer = new CountdownTimer({
count: 10, // default 59
interval: 1000, // 1 second
bound: 0, // default 0
});
timer.on('change', (count) => {
console.log(count); // 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
});
timer.on('end', (count) => {
console.log('complete', count); // complete 0
});
// start timer
// default is decrement
timer.start();
// start timer with increment
timer.start("increment");