Replies: 1 comment
-
For event handlers and similar things (subscriptions etc) registered in a component of app, the right thing is almost always to release them in time. If a subscription outlives a component, its initialization could be moved elsewhere.
I guess not. All should happen in browser , unless they triggered something that in turn adds to server's work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an Angular application where every time a controller is executed, it executes a new
socket.on
to be able to update its internal variables when the server triggers an event.It turns out that if I exit the controller and the event configured in the original
socket.on
is triggered by the server, that event will be reexecuted (tests performed with console.log within the executed function).Is the best procedure to run socket.off? If so, could this cause performance issues on the server?
Beta Was this translation helpful? Give feedback.
All reactions