0.0.7 • Published 3 years ago
@meteora-digital/timesheet v0.0.7
Timesheet
A class to create and toggle multiple timers to help improve time keeping.
Installation
npm i @meteora-digital/timesheet
yarn add @meteora-digital/timesheet
Usage
import Timesheet from '@meteora-digital/timesheet';
const Clock = new Timesheet;
Clock.add('client');
Clock.start('client');
Clock.on('update', (timer) => console.log(timer.value));
Methods
Add a timer to the document
Clock.add('client');
Start a timer
Clock.start('client');
Stop a timer
Clock.stop('client');
Reset a timer
Clock.reset('client');
Get a timer's information
console.log(Clock.get('client'));
Remove a timer
Clock.remove('client');
Callbacks
Available callbacks are: 'init', add', 'start', 'stop', 'update', 'reset', 'remove'.
Clock.on('update', (timer) => console.log(timer.value));