Wednesday, January 07, 2009

Asynchronous function chaining in JavaScript

The If Works » Blog Archive » Asynchronous function chaining in JavaScript: "Another implementation change. A blank ChainCollector instance now has the following properties: then, and, ____ (formerly __enqueue) and fire. The method queue and base object are private variables, and addMethods is a static method. I’m trying to make it as flexible as possible, i.e. it should have the fewest possible named properties but still allow you to extend it to your needs. Also, you now add methods to ChainCollector’s prototype rather than to instances as this is much faster."