Skip to content

An accurate reactive clock package for Meteor. Retains elapsed time and keeps ticking across hot code reloads.

License

Notifications You must be signed in to change notification settings

longshotlabs/meteor-reactive-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aldeed:clock

An accurate reactive clock package for Meteor. Retains elapsed time and keeps ticking across hot code reloads.

Installation

In your Meteor app directory, enter:

$ meteor add aldeed:clock

Usage

var ExerciseClock = new ReactiveClock("ExerciseClock");
ExerciseClock.start();
ExerciseClock.stop();
ExerciseClock.setElapsedSeconds(30);

// reactive
var elapsedSeconds = ExerciseClock.elapsedTime();

// reactive; requires momentjs library
var elapsedTimeHumanized = ExerciseClock.elapsedTime({humanize: true, suffix: true});

// reactive; requires numeraljs library
var elapsedSeconds = ExerciseClock.elapsedTime({format: '00:00:00'});

The elapsedTime function causes your computation to rerun on every 1-second tick.

Contributing

Code contributions and fixes welcome by pull request.

Support via Gratipay

About

An accurate reactive clock package for Meteor. Retains elapsed time and keeps ticking across hot code reloads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published