Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise-based API #42

Closed
inexorabletash opened this issue Oct 7, 2015 · 5 comments
Closed

Promise-based API #42

inexorabletash opened this issue Oct 7, 2015 · 5 comments

Comments

@inexorabletash
Copy link
Member

e.g. https://github.com/inexorabletash/indexeddb-promises

@inexorabletash
Copy link
Member Author

This also handles "unify exceptions with errors" assuming async/await syntax coming in a future edition of ECMAScript.

@nuxodin
Copy link

nuxodin commented Aug 8, 2017

+1

@petamoriken
Copy link

Since ExtendableEvent#waitUntil has already defined in Service Worker, please define IDBTransaction#waitUntil.

@inexorabletash
Copy link
Member Author

TPAC 2019 Web Apps Indexed DB triage notes:

More detailed discussion over in #34 for primitives that would allow wrapping with a promise library, and KV Storage. Closing this out.

@Kuzcoo
Copy link

Kuzcoo commented Feb 3, 2020

Hi,
The discussion is closed but it is not explicit (from an external point of view) that the #34 discussion talks about promise based API.
Is there a will to implement such feature ?

I know there is a quite popular library made by @jakearchibald but I think we should as possible rely on native implementations over library dependencies. This library is pretty popular (2000+ stars), so I think there is a need.
The callback way is very convoluted to the kind of web app that needs such technology as IndexedDB.

As a web developer point of view not familiar with the spec, I find the indexedDB is already quite verbose to use to not benefit from the ease of the promises and by extension async/await

There is the following note on this page:
https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStoreSync

The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.

edit: Well not really sync, but with async/await it could be.

I guess and I hope I am at the right place to ask 😄

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants