Deep Dive into RxJS WebSocket Subject
summary
Claims that Angular’s bundled RxJS provides a ready WebSocket wrapper: the WebSocketSubject sits on the browser W3C websocket, emits incoming messages, buffers outgoing messages when the socket is down, and shares one connection across subscribers to the same subject instance. Default serialization uses JSON.stringify/parse but is pluggable. Reconnect is not automatic so reconnection is implemented with RxJS operators like retryWhen + delayWhen + timer; demo uses an Angular service plus a Node.js ws backend with 2s reconnect attempts and a working live table.
AI-written summary · about
chapters (13)
- 0:00Start
- 3:36Background
- 6:48Websocket Factory Function
- 14:46Error Handling
- 17:02Outgoing Messages Lost When the Connection Is Down
- 17:53Rxgs Websocket Subject Config
- 20:12Websocket Subject Config
- 22:43How To Handle the Reconnection
- 23:14Implement the Reconnection Capability Using Rfcs
- 25:37Vs Code
- 26:57Smart Web Socket Client
- 30:02Websocket Endpoint
- 31:55Connect Method
related talks
47mA deep dive into RxJS WebSocket Subject
23mRxJS, Angular, and WebSockets - The Spy Life
40mWorking with WebSockets in Angular apps
20mReactive Programming with RxJS A Beginner’s Perspective
01h 07mReactive Frontends with RxJS and Angular - Sergi Almar
45mReactive Frontends with RxJS and Angular
58mAngular and The Case for RxJS
44m7 recipes with Angular and RxJS
