UNPKG

q

Version:

A library for promises (CommonJS/Promises/A,B,D)

15 lines (14 loc) 288 B
require("./nano-q"); var x = defer(); setTimeout(function () { x.resolve("Hello, World!"); }, 500); setTimeout(function () { x.resolve("Die in a fire!"); }, 1000); x.then(function (message) { console.log(message); }); x.then(function (message) { console.log(message); });