checklist
var flag = 0;
var flagTimer = setInterval(function () {
flag++;
}, 1000);
var checklist = new jchecks.Checklist({
items: [{
checker: function () {
console.log('checker 1')
return flag > 0
},
processor: function () {
console.log('processor 1')
return null
},
timeout: 5000,
}, {
checker: function () {
console.log('checker 2')
return flag > 3
},
processor: function () {
console.log('processor 2')
return null
},
}]
});
checklist.on('error', function (error) {
console.error(error);
}).on('stop', function () {
console.info('stop');
});
MIT © zswang