Re: [Bug 11348] New: [IndexedDB] Overhaul of the event model

> Also note that the reason that your suggestion removes the need for
> readyState is that your proposal decides to drop support for the
> use-case that readyState aims to help solve. I.e. the ability to
> register additional event handlers sometime after the request is
> created.

All API invocations that I have seen relied on run-to-completion semantics and add a listener after the initial invocation. These now have to check the flag?

Note that one can create the event emitter (and register handlers) before invoking an operation.

>> Then IDBRequest would be more like an event, right? It would be sent to the onsuccess and onerror event handlers.
> I don't understand what you mean here. But in the current model (both
> the one that's in the spec right now, and the one that I'm proposing)
> we're using real DOM-Events. Can't really get more "like events" than
> that?

Right, Iím sorry. I was confused, because IDBRequest plays double duty. To me an event is something that is created at the event emitter and directly sent to event handlers, without exposing it inbetween. That is too narror and IDBRequest is indeed an event.

Dr. Axel Rauschmayer

Received on Friday, 28 January 2011 09:16:21 UTC