What problem does it solve?
Handling cross-cutting concerns in a @data-client application—such as websocket streams, polling, logging, analytics, error reporting, and offline persistence—requires redux-style middleware that reacts to dispatched actions, which is complex to implement correctly from scratch.
Core Features & Use Cases
- Middleware Patterns: Provides working examples for logging, Sentry error reporting, fetch timing metrics, and toast notifications keyed off action types like SET_RESPONSE and FETCH.
- Real-Time & Sync: Covers websocket/SSE push streams, polling intervals, cross-tab sync via BroadcastChannel, and refetch on window focus or network reconnect.
- Persistence & Auth: Demonstrates IndexedDB offline persistence with state restore, and logout handling on 401 via controller.resetEntireStore().
- Use Case: Add a Manager that listens to SUBSCRIBE/UNSUBSCRIBE actions and routes them to a custom websocket transport, consuming the actions so other managers skip them.
Quick Start
Ask the AI to implement a @data-client Manager that refetches all data when the browser window regains focus.