Sat 11 Oct 2014 10:42AM

JavaScript Promises

EP elf Pavlik Public Seen by 82

Lately I really enjoy using promises in js. Yesterday I just played with using them for accessing LevelGraph https://github.com/hackers4peace/ipotables/blob/849aeb5807299762fc64629e28521a23a427209a/app.js#L15-L72

Week earlier I also used it for clean way of doing async requests to remote API https://github.com/elf-pavlik/cfapi-browser/blob/4561e701ecef6bed8869f897f549f199e946171e/app.js#L32-L92

I also recommend interesting articles by James Coglan
* https://blog.jcoglan.com/2013/03/30/callbacks-are-imperative-promises-are-functional-nodes-biggest-missed-opportunity/
* https://blog.jcoglan.com/2013/04/01/callbacks-promises-and-simplicity/

Also for any real time app I did in a past I always ended up using his implementation of Bayeux - http://faye.jcoglan.com/


Bob Haugen Sat 11 Oct 2014 10:54AM

@elfpavlik - Very nice! Studying...


Mikey Sat 11 Oct 2014 10:26PM

i think promises are really awesome, unless you run into a bug that's hard to debug due to their underlying complexity. ;)