-
Notifications
You must be signed in to change notification settings - Fork 407
Socket.IO #828
Comments
@Kaffiend ,currently you have to use |
I guarantee this is not optimal, but the only way I found to wrap the emitter .on event, was something like this: let socketOn = socket.on;
socket.on = (event: string, fn: () => any) => {
let wrappedFunction = function() {
let args = arguments;
zone.run(() => fn.apply(this, args));
};
return socketOn.apply(socket, [event, wrappedFunction]);
}; |
Although, its weird. I do see that websockets themselves are wrapped. socket.io uses the Component Emitter for handling its events: https://www.npmjs.com/package/component-emitter |
I added ngrx to manage state better and discovered that |
Will zone be patched any time soon for Socket.IO? |
@Kaffiend , I am working on it, I will create a PR soon. |
Is there a way we can get Socket.io to run within zone? or will we manually have to run every socket callback through zone?
The text was updated successfully, but these errors were encountered: