https://github.com/gera2ld/sync-promise-lite
DEPRECATED in favor of promise-lite.
https://github.com/gera2ld/sync-promise-lite
Last synced: about 2 months ago
JSON representation
DEPRECATED in favor of promise-lite.
- Host: GitHub
- URL: https://github.com/gera2ld/sync-promise-lite
- Owner: gera2ld
- Created: 2015-12-13T17:35:54.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-20T14:37:54.000Z (over 9 years ago)
- Last Synced: 2026-05-12T00:32:17.321Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
SyncPromise
===



A synchronous promise polyfill based on
[promise-lite](https://github.com/gera2ld/promise-lite).
Why this?
---
Promise is a native asynchronous way to handle operations. But it fails webSQL
and indexedDB transactions in some browsers because of at least two kinds of
reasons:
1. Transactions should be short lived, so they should be closed before returning
back to main event loop. In some browsers (e.g. Firefox), the tranaction will
be closed whenever we exit the current event loop, even if we are using
`Promise` and should not really go back to main event loop. However, Chrome
works well with this via native `Promise`.
1. Some browsers do not support native `Promise`s, while the polyfills implement
asynchronous `Promise`s by `setTimeout` or `requestAnimationFrame`, which
will go back to main event loop for a while and fail the transactions of
course.
To solve the problems above, this special polyfill is implemented.