Skip to content

When you want to resolve/reject a promise from the outside

License

Notifications You must be signed in to change notification settings

emilbayes/inverted-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inverted-promise

Build Status

When you want to resolve/reject a promise from the outside

Usage

var InvertedPromise = require('inverted-promise')

var iP = new InvertedPromise()

var iP2 = new InvertedPromise()

iP.then((value) => {
  console.log(value)
})

iP2.catch((err) => {
  console.log(err)
})

iP.resolve('Hello')
iP2.reject('World')

API

const ip = new InvertedPromise()

Create a new InvertedPromise

ip.resolve(value)

Resolve the promise

ip.reject(error)

Reject the promise

Install

npm install inverted-promise

License

ISC

About

When you want to resolve/reject a promise from the outside

Resources

License

Stars

Watchers

Forks

Packages

No packages published