Re: [IndexedDB] IDBRequest Interface Questions

On Mon, Mar 22, 2010 at 4:56 PM, Shawn Wilsher <> wrote:

> On 3/16/2010 2:27 PM, Shawn Wilsher wrote:
>> Hey all,
>> I'm starting to work on a prototype of the IndexedDB spec to get a
>> better understanding of it. While working with the IDBRequest I think I
>> understand why nobody likes the current event-based model. I'm also
>> seeing that as it is currently specified, it doesn't meet the
>> requirements of the web developers we had talked to were looking for in
>> an event based API (per the latest editors draft on March 16).
>> Essentially, what they wanted was a way to add more than one listener
>> for success or error, and it doesn't look like that is currently
>> possible unless you roll your own callback that manages this (which they
>> wanted to avoid doing). As they described it, they wanted to be able to
>> use something like addEventListener with the option of also just setting
>> onsuccess and onerror (much like how XHR works).
> More specifically, I'm suggesting that IDBRequest inherit from EventTarget
> [1].

I'm guessing not having it inherit from EventTarget was simply an oversight.
 If we go with the current model, that seems like the way to go.

On Tue, Mar 16, 2010 at 9:27 PM, Shawn Wilsher <> wrote:

> I also can't seem to figure out what the success event is supposed to be
> for just about anything.  Am I just missing something, or is this not yet
> specified?

When onsuccess fires, you can then start the next request.

Do you have anything to say regarding a callback based API vs. event one
that inherits from EventTarget?

Received on Monday, 22 March 2010 17:05:57 UTC