0.0.1 • Published 2 years ago

easyc v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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;
}
0.0.1

2 years ago