W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2013

[whatwg] Proposal: createImageBitmap should return a "Promise" instead of using a callback

From: Justin Novosad <junov@google.com>
Date: Wed, 19 Jun 2013 09:19:35 -0400
Message-ID: <CABpaAqR0hRByiu1oPzCZzFxagKtia_X2wtrn082LrdpDAqn69A@mail.gmail.com>
To: WHAT Working Group <whatwg@whatwg.org>
I was about to launch the implementation of window.createImageBitmap in
Blink, and I received feedback on the blink-dev mailing list that the
"Promise" API is the wave of the future for asynchronous JS, and that the
new createImageBitmap method should use Promises.

Current spec:
http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#images

The proposal is to change the ImageBitmapFactories IDL to something like
this:

[NoInterfaceObject]
interface ImageBitmapFactories {
  Promise createImageBitmap(ImageBitmapSource image, optional long sx, long
sy, long sw, long sh);
};

The value of the promise would resolve to an ImageBitmap object.

What do we think?
Received on Wednesday, 19 June 2013 13:20:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:22 UTC