jsonxr / examples-js-promises

Example of how to use promises using the q library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Promises vs Callbacks

npm install

Callbacks

node callbacks.js

This shows an example of chaining calls together using callbacks. This leads to a style called Christmas Tree code because it resembles a christmas tree.

Promises

node promises.js

This shows how to chain calls together using the q library and promises.

About

Example of how to use promises using the q library


Languages

Language:JavaScript 100.0%