rwaldron / temporal

Non-blocking, temporal task sequencing. For use with robots built with Johnny-Five
http://johnny-five.io/
MIT License
84 stars 12 forks source link

Feature proposal #13

Closed dtex closed 7 years ago

dtex commented 8 years ago

I have a problem...

This issue highlighted a bug that manifests when running multiple animations concurrently. In this situation:

ledA.pulse();
setTimeout(function() {
  ledB.pulse();
}, 500);

The second call to pulse will cause the led's animation() to call clear on a temporal instance but temporal.js shares a single queue for all instances of Temporal. This is nice because we aren't dumping multiple processQueue tasks onto the end of the event loop, but it's also a pain because I need to be able to clear just one animation's entries in the queue. I would like to add the ability to pass in an ID with each entry and have the option of calling:


temporal.clear(); /// clears all entries

// -- or --

temporal.clear(myid); // Only clears entries with an ID === myid

If this sounds like a good idea, I'll whip up a PR.

rwaldron commented 8 years ago

Go for it

dtex commented 7 years ago

Handled in #15