useWebSocket: Production-Ready Real-Time Hook for React
Stop fighting connection drops. A WebSocket hook with automatic reconnection, heartbeat keep-alive, offline message queue, auth token injection, and send with acknowledgment all in one file.
shubhra.dev
Loading...
4 snippets with this tag
Stop fighting connection drops. A WebSocket hook with automatic reconnection, heartbeat keep-alive, offline message queue, auth token injection, and send with acknowledgment all in one file.
A zero-dependency React hook for infinite scroll. Intersection Observer, AbortController-safe reset, smart retry, and React 18+ Strict Mode support.
Three React hooks for debouncing values, API queries, and form inputs. Leading/trailing edge control, maxWait burst protection, works with TanStack Query and React Hook Form out of the box. Only imports React. Nothing else.
Stop losing user data. A React Hook Form auto-save hook with debounce, offline queue, retry with exponential backoff, localStorage crash recovery, version tracking, and Zod validation. One hook. One file.