Very efficiently manage time-based events and objects.
MIT License
Published by arjunmehta almost 8 years ago
Some slight but more useful and clear changes to BeatEvent creation and callbacks.
heart.createEvent
now accepts countTo
as an option in place of of repeat
, and the callbacks are now called with the number of times that event has happened instead of the heart's age.
This makes more sense than before, where the keyword repeat
was a bit confusing, and the heartAge
as the callback argument was less useful.
heart.createEvent(5, {repeat: 2}, function(heartAge, last){
console.log('...heart age is', heartAge);
});
heart.createEvent(5, {countTo: 2}, function(count, last){
console.log('...Has happened', count, 'times');
});
Published by arjunmehta almost 8 years ago
Published by arjunmehta almost 8 years ago
With release 4.0.0 there is a (potentially) breaking change, but for the better.
Now a Heart
will keep your Node app alive (if you are using Node) if there are events in queue.
Upon the completion of the very last event, the Heart will be unreferenced and your app will exit, as would be expected.
Published by arjunmehta almost 8 years ago
Published by arjunmehta almost 8 years ago
Addresses an issue with importing on browsers.
Published by arjunmehta almost 8 years ago
Published by arjunmehta over 9 years ago