ws
Description
Usage
import { share } from 'rxjs/operators';
import { ws, messages } from '@buccaneer/rxws';
// create a websocket
const websocketParams = {
url: 'wss://mysite.com',
topics: ['message', 'news'],
};
const ws$ = ws(websocketParams).pipe(
share() // create the websocket and multicast it into an RxJS Subject
);
// get messages from the websocket:
const message$ = ws.pipe(
messages()
);
message$.subscribe(console.log);
// This would log the messages received from the serverAPI
Since
Parameters
Options
Returns
Last updated