promise-deferred

A lightweight Deferred implementation, on top of Promises/A+

npm install promise-deferred
12 downloads in the last week
30 downloads in the last month

promise-deferred Version Badge

Build Status dependency status dev dependency status

npm badge

browser support

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

npm loves you