count-down-ts
Countdown has timer, count, clear features. Test covered 100%.
Install
npm
npm install count-down-ts --save
yarn
yarn add count-down-ts --save
bower
bower install count-down-ts --save
Import
ES2015
CommonJS
const countdown =
script
DEMO
Usage
// init countdowncountdown.start60, 0, console.logc OR countdown.start // cleat countdown setTimeout & count & timercountdown.clear // countdown setTimeout return valuecountdown.timer // countdown current numbercountdown.count
accept-expression
countdown.start(count, down, callback)
count
: Default 60, type number. Tips: count must greater than down, or equal down.
down
: Default 0, type number.
callback
: Type (c: number) => void.