Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How detect if a client disconnected? #18

Open
derwaldgeist opened this issue Jul 11, 2017 · 3 comments
Open

How detect if a client disconnected? #18

derwaldgeist opened this issue Jul 11, 2017 · 3 comments

Comments

@derwaldgeist
Copy link

First of all, thanks for that great replacement for meteorhacks:streams. It took me only minutes to make the switch. However, I am missing one feature that was available in the streams package: To define a function that is called when the connection to the client is lost. In streams, this was possible using this.onDisconnect in an on() event handler.

@mikaelmello
Copy link

+1, any update on that?

@sampaiodiego
Copy link
Member

sry for the huge delay.. 😞

but is there any reason to have this information on the stream package? you can do it on meteor level: https://docs.meteor.com/api/connections.html#Meteor-onConnection (look at onClose)

@mikaelmello
Copy link

In my case I wanted to reset a property from the User model whenever it disconnects from the stream.

This property is usually set right after "subscribing" to the stream, erasing its previous value and setting it to the new.

However when it is not set, it should be undefined instead of having the previous value and I can't depend on the client to reset everytime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants