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

Custom function for On Reconnect socket #97

Open
cschwaderer opened this issue Sep 15, 2016 · 1 comment
Open

Custom function for On Reconnect socket #97

cschwaderer opened this issue Sep 15, 2016 · 1 comment

Comments

@cschwaderer
Copy link

Using version 2.0.0-beta.3 of angular sails, I'd like to set up a custom function whenenever the connection/user socket is reconnected (e.g. after network problems).

But I don't know how to do that and whether it's possible at all.

Inside, angular-sails.js, I was able to run the lines of code below inside the SailsIo.prototype.connect function:

self.on('reconnect', function(attemps) {
console.log("Foooo");
});

But of course, that's not where such a function should be put. So, how can I put that into my own code?

@cschwaderer
Copy link
Author

Well, I think it's simply

$sails.on('reconnect', function(attemps) {
console.log("Foooo");
}

So, please forget about that stupid question. I was confused by my own code.

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

1 participant