I use ngx-socket-io
package to implement sockets.
For some implementation reasons, I use a lot of namespaces and need to pass the data parameter from a component to the site build.
I tried to use socket.of(namespace: string
) but I can't add options parameter.
@Injectable()
export class UsersListUpdateSocketService extends Socket {
userListsUpdate$ = this.fromEvent<user[]>('update-users');
constructor() {
super({
url: `${environment.socketUrl}/${SocketEnum.USER_LIST}`,
options: { data: { parameter: 'value' } }
});
}
}
The problem is:
I would like, from components, change { data: { parameter: 'value' } }
to { data: { parameter: 'value2' } }
etc.
if chat is your namespace, then you need to supply it in the url of configuration like this:
or
but below ex awesome: