Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ovictoraurelio/promise-remotely
A simple and powerful Promise lib that give to you capability to remote resolve/reject a promise.
https://github.com/ovictoraurelio/promise-remotely
async await await-promises concurrency javascript promise remotely
Last synced: 1 day ago
JSON representation
A simple and powerful Promise lib that give to you capability to remote resolve/reject a promise.
- Host: GitHub
- URL: https://github.com/ovictoraurelio/promise-remotely
- Owner: ovictoraurelio
- License: mit
- Created: 2022-06-20T02:28:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-26T04:00:13.000Z (over 2 years ago)
- Last Synced: 2024-10-11T23:11:02.801Z (about 1 month ago)
- Topics: async, await, await-promises, concurrency, javascript, promise, remotely
- Language: JavaScript
- Homepage: https://npmjs.com/package/promise-remotely
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```shellnpm i promise-remotely
```
### Then import the package
```javascript
import PromiseRemotely from 'promise-remotely'
```#### Create a Instance of a remote promise
```javascript
const sampleRemotePromise = PromiseRemotely()
```#### To remotely solve the promise
```javascript
sampleRemotePromise.resolve()
```#### To remotely reject the promise
```javascript
sampleRemotePromise.reject()
```#### You can either pass a result object
```javascript
sampleRemotePromise.resolve({ status: 200 })
```#### How await the remote promise
```javascript
const result = await sampleRemotePromise.promise
```