- From: Brian LeRoux <brian@westcoastlogic.com>
- Date: Wed, 28 Apr 2010 09:41:46 -0700
- To: Robin Berjon <robin@robineko.com>
- Cc: Anselm R Garbe <garbeam@gmail.com>, public-device-apis@w3.org
Agree its a little dangerous (giving the illusion of a sync api) and
more verbose. Feel the API pattern of win/fail/options is the better
way to go.
On Wed, Apr 28, 2010 at 9:24 AM, Robin Berjon <robin@robineko.com> wrote:
> On Apr 28, 2010, at 15:01 , Anselm R Garbe wrote:
>> One idea I proposed originally in BONDI was having all callbacks at
>> the end of functions:
>>
>> void func(options, [successCB, [errorCB]]);
>>
>> The advantage would have been that an implementation would have been
>> able to react sync or async depending of the arguments passed in (eg
>> if no CBs passed in, it could have done the operation synchronously).
>
> I like the DWIM nature of it :) But on the downside it requires to pass null or {} when there are no options, and I have a feeling that using it to decide on the synchronicity of the call is perhaps a little too smart. Also, we don't want all calls to be usable synchronously!
>
> --
> Robin Berjon
> robineko — hired gun, higher standards
> http://robineko.com/
>
>
>
Received on Wednesday, 28 April 2010 16:42:18 UTC