This commit is contained in:
tiago.kayaya
2021-05-19 09:37:43 +01:00
parent 6997295a31
commit 0f60f237b1
9 changed files with 23 additions and 17 deletions
+3
View File
@@ -24,6 +24,9 @@ export class WebsocketService {
private create(url): Rx.Subject<MessageEvent> {
let ws = new WebSocket(url);
console.log(ws);
let observable = Rx.Observable.create((obs: Rx.Observer<MessageEvent>) => {
ws.onmessage = obs.next.bind(obs);
ws.onerror = obs.error.bind(obs);