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

name undefined on connect #63

Closed johnou closed 13 years ago

johnou commented 13 years ago

I've put together a small test application which produces the undefined output, perhaps I am not taking the right approach?

johnou commented 13 years ago

And here I was thinking I could attach a file after I submitted the issue :) I will send it to the team mailing list.

dvv commented 13 years ago

Or you could create a public gist instead ;)

johnou commented 13 years ago

Here you go! https://gist.github.com/938746

ericz commented 13 years ago

Due to browser limitations, new variables values have a slight delay. This means the first time you set now.name there will be a < 1 second lag time before it gets synced to the server, this is purely a browser limitation. However subsequent changes to the variable will be real time.

There is no promise that .connected on the server is called after specific variables have been set on the client, instead the best practice is for the client to call a server function when the client has finished settings its variables.