too-late
v0.1.2
Published
events with timeouts
Downloads
11
Readme
too late
events with timeouts
npm install 'too-late'
var customer = require('too-late')();
customer.waitfor('food', function(food) {
console.log("eat " + food);
}).till(30, function() {
console.log('customer left, you are too late');
});
setTimeout(function() {
customer.deliver('food', 'patato spaghetti');
}, 40):
output
customer left, you are too late
wait for multiple events
var customer = require('too-late')();
customer.waitfor(['food', 'drink'], function(food, drink) {
console.log(food + " and " + drink);
}).till(50, function(served) {
console.log('customer left, you are too late');
});
setTimeout(function() {
customer.deliver('food', 'patato spaghetti');
}, 20):
setTimeout(function() {
customer.deliver('drink', 'soda water');
}, 40):