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