Skip to content

seangenabe/es6-deferred

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

es6-deferred

Deferred the ES2015 way.

npm Build Status Dependency Status devDependency Status

It's not really ES2015 if it's just a polyfill...

Deprecation notice: Polyfill will be removed in due time. Versions of node.js without the required features will not be supported.

Usage

var Deferred = require('es6-deferred');
var d = new Deferred();

d.promise

The promise.

d.resolve(value)

Resolves the promise with the given value.

d.reject(error)

Rejects the promise with the given error.

d.then(onFulfilled, onRejected)

Appends a fulfillment and rejection handler to the promise.

d.catch(onRejected)

Appends a rejection handler to the promise.

License

MIT