snooze.callback
v1.0.4
Published
Snooze Callback to call when time is up. It will help to avoid redundancy work such as hitting database query
Downloads
7
Readme
snooze-callback
Snooze Callback to call when time is up. It will help to avoid redundancy work such as hitting database query, or network call. We used this package to future schedule events.
debug
set environment: DEBUG="snooze*"
example
const { watch, intervalTime, cancel } = require('./index');
intervalTime(1000);
const timeObj = {
'2018-10-10T16:12:48.761Z': { context: this, data: "hello world"},
'2018-10-10T16:14:46.761Z': { someFun: () => console.log('yay',timeObj), data: "hello world"}
}
watch( timeObj, function (error, data) {
if (error) return cancel()
console.log("Callback Trigger with param", data);
}, this);