Showing posts with label NodeJS. Show all posts
Showing posts with label NodeJS. Show all posts

Friday, June 27, 2014

Using Promises Instead of Callbacks

Stop using nested callbacks for async function calls in JavaScript!
https://blog.jcoglan.com/2013/03/30/callbacks-are-imperative-promises-are-functional-nodes-biggest-missed-opportunity/

A detailed comparison between various implementations of Promise:
http://complexitymaze.com/2014/03/03/javascript-promises-a-comparison-of-libraries/

Bluebird is albeit the fastest Promise implementation in the market.
https://github.com/petkaantonov/bluebird

JQuery already uses Promise in its async operations, e.g., get, post, ajax, etc.

Scala also has Promise, aka Future:
http://docs.scala-lang.org/overviews/core/futures.html