$ npm install promise-deferred
A lightweight Deferred implementation, on top of Promises/A+
var Deferred = require('promise-deferred');
var deferred = new Deferred();
// set up handlers
deferred.promise.then(function (value) {}, function (error) {});
// resolve
deferred.resolve('a value');
// reject
deferred.reject(new Error('oh noes'));
Simply clone the repo, npm install
, and run npm test
© 2010 - cnpmjs.org x YWFE | Home | YWFE