W3C home > Mailing lists > Public > public-secondscreen@w3.org > May 2015

Re: [presentation-api] Added defaultsessionstart and default-presentation <link> to the spec

From: Anton Vayvod via GitHub <sysbot+gh@w3.org>
Date: Wed, 13 May 2015 17:04:41 +0000
To: public-secondscreen@w3.org
Message-ID: <issue_comment.created-101748025-1431536680-sysbot+gh@w3.org>
I believe we could have a generic onsessionstart event then and 
abandon returning a Promise from start/joinSession resulting in a more
 unified API and smaller API surface. Not sure it would be convenient 
for the page because it might have to track what request is being 
resolved with the new session passed in onstart. Although the page 
might not care much.

Having a Promise returned for startSession/joinSession is better for 
error handling though - the page makes a request and either gets a 
session or gets an error. There's no issue with the timing of when 
event listener is attached. If we use an event handler to pass the 
result of startSession/joinSession to the page, we'd have to add 
onsessionfail, for example.

I think a Promise based API for startSession/joinSession is better.

GitHub Notif of comment by avayvod
Received on Wednesday, 13 May 2015 17:04:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 13 May 2015 17:04:42 UTC