Comment

Comment by bwindels

IIRC the main reason indexeddb does not use promises is because promises are required to reject/resolve asynchronously [1]. Indexeddb requires that you manipulate the object stores in a synchronous way from it's event handlers, so it can terminate the transaction after running the event handlers synchronously. It can't do this with promises that will run their resolve handler at best in the next microtask.

It's been a while since I looked into this, but I remember this being my conclusion.

1: https://promisesaplus.com/#point-34

parent bwindels 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton