easyc
v0.0.1
Published
An easy countdown
Downloads
2
Readme
Easy Countdown
Installation
npm i easyc
Example
import Easyc from 'easyc'
const countdown = new Easyc((seconds: number) => {
console.log(seconds)
})
countdown.start(60)
countdown.seconds // 60,59,58,57,56,55...
Interface
State in seconds:
-1
: not started>0
: counting down=0
: over
declare class Easyc {
seconds: number;
constructor (cb?: (seconds: number) => void);
start (seconds: number): void;
end (): void;
reset (): void;
cancel (): void;
destroy (): void;
}