promise-remotely
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

promise-remotely

Create native ES6 promises that can be resolved or rejected externally.

A simple and powerful Promise package that give to you capability to remote resolve/reject a promise.

Getting Started

First of all install the package

npm i promise-remotely

Then import the package

import PromiseRemotely from  'promise-remotely'

Create a Instance of a remote promise

const sampleRemotePromise  =  PromiseRemotely()

To remotely solve the promise

sampleRemotePromise.resolve()

To remotely reject the promise

sampleRemotePromise.reject()

You can either pass a result object

sampleRemotePromise.resolve({  status:  200  })

How await the remote promise

const result = await sampleRemotePromise.promise

Package Sidebar

Install

npm i promise-remotely

Weekly Downloads

39

Version

0.1.3

License

MIT

Unpacked Size

3.7 kB

Total Files

5

Last publish

Collaborators

  • ovictoraurelio