123 karma · joined July 1, 2013
All these private methods are going to be duplicated for every object created. The whole point of the 'this' magic in javascript is to allow the same function, ie. the same memory usage, to be used with 1000s of objects with no hit. Here, you're going to get unique functions, extra memory, for just having the 'this' operator substituted by a variable named _elem. This code is fundamentally flawed and I severely suggest to never use closures for shared object methods when instead a shared method that is bound using '.bind' will ensure much better performance and memory usage.
Also useful if you need to wait until after all event handlers are executed in the current context
Basic event loop is; timeouts, js execution, repaint, reflow, etc
This 1937 video about differentials is also enlightening:
http://www.youtube.com/watch?v=yYAw79386WI
Why is it that old tutorial videos are so thorough and informative?
I like this async syntax but I'm more fond of native JS generator trampoline. I think the JSOperation with dependencies could even use generators in its implementation.
All these solutions coming about after the C# async article are very enlightening to this problem of the synchronic vs diachronic vs asynchronic.
The JSOperations lib is in alpha but can be found here https://github.com/iandrewfuchs/JSOperations/blob/master/REA...