A package for managing WebSocket lifecycle with RxJS, inspired by Angular's WebSocket module but framework-agnostic. Current stable version 1.2.3, released monthly. Key differentiator: automatic reconnection, heartbeat, and message queuing handling in a single observable pipeline. Built for browsers and Node.js environments, ships TypeScript types.
npm install customapp-rxjs-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a WebSocket client with reconnection, heartbeat, and message handling.
Use import { WebSocketClient } from 'customapp-rxjs-websocket' instead of import WebSocketClient from ...Use 'connected' | 'disconnected' | 'reconnecting' instead of ConnectionStatus.CONNECTED.
Ensure you import necessary operators: import { filter, map } from 'rxjs/operators'.Use custom serializer/deserializer options if binary messages are required.
Use import { WebSocketClient } from 'customapp-rxjs-websocket' instead of const { WebSocketClient } = require(...). Ensure your project is set to ES module.Add WebSocketModule to imports array in your Angular module or component imports.
Ensure you subscribe to messages$ or status$ before calling connect(), or wait for connection status.
Install rxjs-compat if using v6 patterns, or migrate to v7: import { webSocket } from 'rxjs/webSocket'.