Global Promise
A helper library to create a promise to be resolved/rejected from your other parts of codebase globally.
Installation
Install it from npm
:
$ npm install global-promise
or
$ yarn add global-promise
Motivation
Sometimes, we create a promise and we needed to resolve/reject it from other part of codebase globally.
We can achieve the same by implementing event driven code using EventTarget
or EventEmitter
,
but it will require a lot of code.
Solve it with GPromise
with a few of lines of code:
;// Creates a promise to be settled from other parts of code.GPromise;// In your other part of code:;
Test
Run:
yarn test
Contributing
Your PRs and stars are always welcome.