promise-deferred
v2.0.4
Published
A lightweight Deferred implementation, on top of Promises/A+
Downloads
626,242
Maintainers
Readme
promise-deferred
A lightweight Deferred implementation, on top of Promises/A+
Examples
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'));
Tests
Simply clone the repo, npm install
, and run npm test