Re: [IndexedDB] Promises (WAS: Seeking pre-LCWD comments for Indexed Database API; deadline February 2)

On 3/5/2010 4:54 AM, Jeremy Orlow wrote:
> For what it's worth, regardless of the answers to the above questions, I
> think we should switch to a callback based model.  It's great to use
> events when natural to do so, but this is a very unnatural use.  It
> provides artificial limitations (only one request in flight at a time,
> per request object).  It's ugly and confusing syntax wise (hard to keep
> track of which request object is associated with which request method,
> requires multiple statements to do each request, requires the handlers
> to be placed prior to the actual call...which is why the async example
> in http://www.w3.org/TR/IndexedDB/#introduction is so difficult to read,
> etc).  And there really isn't any precedent (that I'm aware of) for
> using events like this.  And the web developers I've spoken to have all
> been confused by the async API.
For what it is worth, all the web developers we've talked to have pushed 
for an event based API, which is why we've been pushing for it.  This 
happened with the file reader API as I understand it (Jonas or Arun 
would be able to say more).

Note that we didn't show them this exact API.

Cheers,

Shawn

Received on Friday, 12 March 2010 01:04:21 UTC