@renovator/counter

1.0.0 • Public • Published

@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");

Readme

Keywords

none

Package Sidebar

Install

npm i @renovator/counter

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

6.58 kB

Total Files

9

Last publish

Collaborators

  • kenny6520