You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the "reworked APIs" section, IDBRequest becomes a subclass of Future.
IDBTransaction behaves similarly, although it's not as simple a type as a IDBRequest. A transaction has a lifetime bounded by other asynchronous activity, after which it completes successfully ("complete" event) or fails ("abort" event), and in both cases action is likely to be taken by the script.
This is a good point, although I'd also like a more explicit API that provides some control over how to extend the lifetime of a transaction. I've suggested to @sicking in the past that we add something like a .transact() method (in the context of LSA which could vend a Promise. But you're right: the existing thigns that vend transactions should change to vend Promises. Patches welcome.
In the "reworked APIs" section, IDBRequest becomes a subclass of Future.
IDBTransaction behaves similarly, although it's not as simple a type as a IDBRequest. A transaction has a lifetime bounded by other asynchronous activity, after which it completes successfully ("complete" event) or fails ("abort" event), and in both cases action is likely to be taken by the script.
With current IDB you write:
I'd expect a Future-ish IDB to let me write:
... which of course gets more useful when you have join() operations letting you wait on multiple futures and all that other goodness.
The text was updated successfully, but these errors were encountered: