kriszyp / promised-io

Promise-based IO for JavaScript.
http://www.persvr.org/
236 stars 35 forks source link

jQuery deferred object-like syntax #38

Open tomkit opened 11 years ago

tomkit commented 11 years ago

I wrote a quick wrapper API around whenPromise() to be more like jQuery's deferred object syntax: https://github.com/tomkit/promised-io-deferred. Would love to get people's thoughts on the pros/cons of the different syntax styles. Personally I found myself being lazy with anonymous functions with whenPromise() and it leads to having more nested code.

vicary commented 11 years ago

:+1:

Don't know if it is about the Promises/A spec, but I found the suggested methods very demanding in terms of development cycle. The jQuery deferred style implies a really rapid coding style.

Me and my team loves to do .done() on development along with some initial .fail(), then start to add more .fail()s at the debug stage, we already found this approach very constructive.