var a, async = function(f) { setTimeout(function() { var r = 'step 2'; f(r); }, 1); }, myFunc = function() { a = 'step 1'; async(function(r) { a = r; // should reset ...
Promises make asynchronous processing simple, consistent and easy to use. And, with TypeScript and Promises.TypeScript providing support for generic Promises, you get both type safety and IntelliSense ...