Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zbraniecki/syncpromise
Sync drop in replacement for Promises
https://github.com/zbraniecki/syncpromise
Last synced: 3 months ago
JSON representation
Sync drop in replacement for Promises
- Host: GitHub
- URL: https://github.com/zbraniecki/syncpromise
- Owner: zbraniecki
- Created: 2016-07-14T18:02:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-15T07:20:31.000Z (over 8 years ago)
- Last Synced: 2024-09-14T03:59:24.931Z (4 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SyncPromise
SyncPromise is an incomplete implementation of Promise API. SyncPromise executes your Promise based code synchronously.
## Why
Because sometimes you need to test your Promise based code in a sync scenario.
## Features
* Small
* ES6 based
* With tests
* Most of new Promise()
* Most of Promise.prototype.then
* Most of Promise.resolve
* Most of Promise.reject
* Most of Promise.all### Restrictions
Can't handle Promise.prototype.catch for obvious reasons.
## Differences from ECMAScript promises
* Throws when SyncPromise callback ends without resolving the promise
* Throws when attempting to resolve an already resolved promise
* No Promise.prototype.catch
* No Promise.prototype.race (we accept patches!)
* Some other things probably missing...