Re: Google/Mozilla Presentation API update

On Thu, Aug 21, 2014 at 8:57 AM, Anton Vayvod <avayvod@google.com> wrote:
> Each time I see a boolean flag in the parameters list I feel like having two
> functions instead with distinctive clear names instead. Maybe have two
> functions like this:
>
> partial interface NavigatorPresentation {
>   PresentationSession startSession(DOMString url, DOMString sessionId);
>   PresentationSession joinSession(DOMString url, DOMString sessionId);
> }

Yes! I like this!

> Also, what do the function(s) return if the session is not established (e.g.
> user exits the selection UI by dismissing the popup menu or there's no
> existing session to join) ? An uninitialized useless session object? Or
> should we change the return type to a Promise that passes a session to the
> caller if it succeeds?

I think returning a Promise is likely going to make for a easier to
use API. That makes it very clear when connection has been
established, and when connection failed.

/ Jonas

Received on Friday, 22 August 2014 23:55:58 UTC