0.2.3 • Published 8 years ago

sync-promise-lite v0.2.3

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

SyncPromise

NPM Licence Downloads

A synchronous promise polyfill based on 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.
  2. Some browsers do not support native Promises, while the polyfills implement asynchronous Promises 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.

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago