Neptune's Potato Monsters

    This package has been deprecated

    Author message:

    Please use @gera2ld/promise-lite instead.

    sync-promise-lite

    0.2.3 • Public • Published

    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.

    Keywords

    Install

    npm i sync-promise-lite

    DownloadsWeekly Downloads

    17

    Version

    0.2.3

    License

    MIT

    Last publish

    Collaborators

    • gera2ld