W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

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

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 27 Jan 2011 17:48:02 -0800
Message-ID: <AANLkTikZrkwy6Ra9tBAddUrTV9KH0WH-p=8B49JhJsP-@mail.gmail.com>
To: Axel Rauschmayer <axel@rauschma.de>
Cc: Jeremy Orlow <jorlow@chromium.org>, public-webapps@w3.org
On Thu, Jan 27, 2011 at 5:30 PM, Axel Rauschmayer <axel@rauschma.de> wrote:
> I am really sorry to bring this up again, but: Why not separate concerns? Why not separate input data and output data?
>
> If onsuccess and onerror were handed in as an input parameters, would there be any need for readyState, LOADING, and DONE?

We decided a long long time ago, based on input from web developers,
to use DOM-Events as notification mechanism. We went through the same
thing in the FileReader API where I initially suggested using a
different type of callback, but got the feedback that developers
preferred to use DOM-Events.

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.

> 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?

/ Jonas
Received on Friday, 28 January 2011 01:48:55 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:16 UTC