Package Exports
- clock-scheduler
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (clock-scheduler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
clock-scheduler
Same as setTimeout
and setInterval
but pinned to the clock.
import Clock from 'clock-scheduler';
const Clock = require('clock-scheduler');
// https://unpkg.com/clock-scheduler
// will log next date whenever the next minute will tick
const uid = Clock.setTimeout(
// a callback to invoke at next clock tick
random => console.log(random, new Date),
// second(s), minute(s), hour(s), day(s), month(s), year(s)
'minute',
// any extra argument allowed, just like setInterval/Timeout
Math.random()
);
// Clock.clearInterval(uid);