too-late

0.1.2 • Public • Published

too late

NPM Version Build Status

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):

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    5
  • 0.1.1
    4
  • 0.1.0
    4
  • 0.0.2
    3
  • 0.0.1
    2

Package Sidebar

Install

npm i too-late

Weekly Downloads

5

Version

0.1.2

License

MIT

Last publish

Collaborators

  • zf