export class ConnectionService {
public messages: Subject<IWSMessage>;
constructor (private wsService:WebsocketService) {
...
this.messages = <Subject<IWSMessage>>wsService.connect(CONNECT_URL).pipe(
map((response: MessageEvent) => {
let data = JSON.parse(response.data);
console.log("WS Get data:",data);
return {
key: data.key,
status: data.status,
data: data.data
};
})
)
...
}
...
}