Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

Client-side now.disconnect event function #83

Closed tommedema closed 13 years ago

tommedema commented 13 years ago

There's a now.ready function for when a connection to the now server has been established. The same event function should be available for when the connection was closed (and preferably with an error code indicating why the connection was closed).

ericz commented 13 years ago

Yep we do plan on implementing this along with reconnection support

ericz commented 13 years ago

Hi tom,

Reconnection support hasn't been completed yet (I'm integrating with socket.io 0.7 right now) but the disconnect event already exists in the github master.

 now.core.on('disconnect', function(){
      // Called upon disconnection, no automatic reconnection right now
 });
tommedema commented 13 years ago

@ericz, thanks. May I ask why the syntax appears different from now.ready ? Other than that, this is exactly what I meant.

ericz commented 13 years ago

now.ready is a alias for now.core.on('ready')

We don't want to add a now.disconnect because it adds more cruft to now namespace

Eric

tommedema commented 13 years ago

Right, personally I would remove the alias too.

2011/5/9 ericz < reply@reply.github.com>

now.ready is a alias for now.core.on('ready')

We don't want to add a now.disconnect because it adds more cruft to now namespace

Eric

Reply to this email directly or view it on GitHub: https://github.com/Flotype/now/issues/83#comment_1125914