diff --git a/client/src/app/shared/services/websocket.service.ts b/client/src/app/shared/services/websocket.service.ts index ee4dea9..551312b 100644 --- a/client/src/app/shared/services/websocket.service.ts +++ b/client/src/app/shared/services/websocket.service.ts @@ -30,17 +30,16 @@ export class WebsocketService { }) } - // public listenTo(topic: string): Observable { - // return this.subject.pipe( - // value => value.topic == topic, + public listenTo(topic: string): Observable { + return this.subject.pipe( + filter((msg: any) => msg.topic === topic), + share() + ); + } - // ); - - // } - - // public data = this.subject.pipe( - // share() - // ); + public data = this.subject.pipe( + share() + ); public send(url: any){ this.subject.next(url);