realtime-socket-react-query

Couple WebSockets with React Query cache invalidation for real-time frontend updates.

1|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/Benmore-Studio/Benmore-Meridian --skill realtime-socket-react-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: realtime-socket-react-query
Source: https://github.com/Benmore-Studio/Benmore-Meridian/tree/main/skills/realtime-socket-react-query
Command: npx skills add https://github.com/Benmore-Studio/Benmore-Meridian --skill realtime-socket-react-query

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Real-time frontend updates require a scalable pattern to notify the UI of backend events without pushing full data through sockets.

Core Features & Use Cases

  • Lightweight event signaling via WebSockets to trigger cache invalidation in React Query.
  • Robust, reconnection-capable socket management synchronized with auth state.
  • Use cases include live dashboards, transaction feeds, and status trackers that stay in sync with the server.

Quick Start

Connect a WebSocket channel at app startup and wire events to invalidate the appropriate React Query caches.

Frequently Asked Questions about realtime-socket-react-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update React Query cache in real-time using WebSockets?

You trigger React Query cache invalidation by mapping incoming WebSocket events to specific queries. This socket-driven invalidation replaces continuous polling to ensure deterministic data freshness for live UI updates.

What is the best way to replace polling with live updates in a React Query app?

The best way to replace polling for live updates is using a socket connection manager to send lightweight event signals that trigger React Query cache invalidation, fetching fresh data only when the backend notifies a change.

How do I handle WebSocket reconnection synchronized with auth state in React?

You handle WebSocket reconnection by implementing a robust socket connection manager that safely reconnects and synchronizes with the application's auth state, ensuring deterministic data freshness without dropping live updates.

Does this real-time WebSocket pattern push full data payloads to the frontend?

No, this pattern uses lightweight event signaling via WebSockets to notify the UI of backend events. It triggers React Query cache invalidation to fetch updated data independently, avoiding the need to push full data payloads through sockets.

Can I use socket-driven cache invalidation for live dashboards and transaction feeds?

Yes, you can use socket-driven cache invalidation for live dashboards, transaction feeds, and status trackers. It keeps React Query-enabled applications perfectly synced with the server for real-time UI updates.