inverted-promise
When you want to resolve/reject a promise from the outside
Last updated 5 months ago by emilbayes .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install inverted-promise 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.1                                ...           latest (5 months ago)

1 Versions

  • 1.0.1                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |