2 ms·
The thing about promises is their real power comes when you return them out of functions you run, thus causing any function to become async, and the promise bei
by dclowd9901 13y ago
The thing about promises is their real power comes when you return them out of functions you run, thus causing any function to become async, and the promise being returned allows it to be used in a variety of ways:
promisesFunc().done(function(){ // execute on completion }
q.when(promisesFunc).then( function(){ // do stuff } )
It's nice to be able to treat something that is inherently asynchronous like it is inherently asynchronous. Feels good man.jpg. And just wait til you start mixing in generators (well, eventually).