promise-make-naked
A simple function that makes a promise that can be resolved, rejected or introspected from the outside.
Last updated 2 years ago by fabiospampinato .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install promise-make-naked 
SYNC missed versions from official npm registry.

Promise Make Naked

A simple function that makes a promise that can be resolved, rejected or introspected from the outside.

Install

npm install --save promise-make-naked

Usage

import makeNakedPromise from 'promise-make-naked';

// Let's create a naked Promise

const {promise, resolve, reject, isPending, isResolved, isRejected} = makeNakedPromise ();

resolve ( 123 ); // Resolve the promise with the provided value
reject ( new Error () ); // Reject the promise with the provided reason

isPending (); // Check if the promise is still pending
isResolved (); // Check if the promise got resolved
isRejected (); // Check if the promise got rejected

License

MIT © Fabio Spampinato

Current Tags

  • 3.0.2                                ...           latest (2 years ago)

8 Versions

  • 3.0.2                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Total 23
Today 0
This Week 0
This Month 11
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE