Re: Concerns about DOMRequest

On Friday, 15 February 2013 at 15:51, Wonsuk Lee wrote:

> > You are assuming that DOMRequest can't do that by design. Adding the
> > following WebIDL would fix DOMRequest to have the same syntax sugar as
> > DOMFuture:
> >  
> > Callback RequestCallback = any (any aValue);
> >  
> > partial interface DOMRequest {
> > DOMRequest then(RequestCallback successCallback, RequestCallback
> > errorCallback);
> > };
> >  
> > It's been in our plans for months to improve DOMRequest to have a
> > future-like design, this is why the specification is phrased like this.
>  
>  
>  
> For clear understanding, could you show up a example code using above WebIDL?  
Something like:  

function success(alarm){ …}
function fail(error){ …}



navigator.alarms.createAlarm(date,"ignoreTimezone").then(success, fail);



--  
Marcos Caceres
http://datadriven.com.au

Received on Friday, 15 February 2013 16:00:10 UTC