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