angular2-websocket
angular2-websocket copied to clipboard
subscribe to a topic
trafficstars
Is it possible after connection to subscribe to different topics, like Stomp client?
var webSocket = new $WebSocket("ws://127.0.0.1:8080/chat"); webSocket.getDataStream().subscribe("topic/bike", ...) webSocket.getDataStream().subscribe("topic/car", ...)
Regards, Tomaž
It is not at the moment, using only the API exposed by angular2-websocket.
However, you could get this done by filtering or groupingBy getDataStream() response.
See sugestions on both aproaches here:
https://stackoverflow.com/questions/28854688/split-rx-observable-into-multiple-streams-and-process-individually