[go: up one dir, main page]

promise-deferred
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/promise-deferred package

2.0.4 • Public • Published

promise-deferred Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

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

Package Sidebar

Install

npm i promise-deferred

Weekly Downloads

122,706

Version

2.0.4

License

MIT

Unpacked Size

22.1 kB

Total Files

9

Last publish

Collaborators

  • ljharb