Untitled
unknown
typescript
2 years ago
409 B
10
Indexable
import { webSocket } from "rxjs/webSocket";
const subject = webSocket('wss://example.com');
subject.subscribe(
msg => console.log('message received: ' + msg), // Called whenever there is a message from the server.
err => console.log(err), // Called if at any point WebSocket API signals some kind of error.
() => console.log('complete') // Called when connection is closed (for whatever reason).
);Editor is loading...
Leave a Comment