Skip to content

kostasmanionis/yaDeferred

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yet another deferred implementation

Build Status

You can never have enough of these, right?

Small, zero dependency deferred utility based on ES2015 promises.

Does not include the promise polyfill, so you have to take care of it yourself folks.

es6-promise

Installation

npm install --save yaDeferred

Usage

const yaDeferred = require('yaDeferred');

yaDeferred()
    .resolve(true)
    .then(result => console.log(result));

API

resolve

yaDeferred.resolve()

resolves the promise with a given value and returns the promise

reject

yaDeferred.reject()

rejects the promise with a given value and returns the promise

then

yaDeferred.then()

then is a direct call to the original promise then method

catch

yaDeferred.catch()

catch is a direct call to the original promise catch method

About

Small, zero dependency deferred utility based on ES2015 promises

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors