hooks & stores
Use the narrower hook whenever you can; reach for the full store only when you need a broad snapshot.
The common set you’ll use for status, cache state, and queue counters.
useEidosStatus() for online / service-worker state in headers and shell UI.useEidosResource(url) for live cache state on a single resource.useEidosQueueStats() for lightweight pending / failed / replaying counters.useEidosAction(id) for a single queue item and useEidosOnDrain() for sync notifications.const { isOnline, swStatus } = useEidosStatus()const { pending, failed } = useEidosQueueStats()
useEidosOnDrain(() => toast.success('All offline actions synced'))Svelte, Vue, and vanilla JS can subscribe to the same store primitives.
subscribe(run) contract.const unsub = eidosStatus.subscribe(({ isOnline }) => { document.title = isOnline ? 'App' : 'App (offline)'})
const hits = eidosResource('/api/products').getState()?.cacheHits ?? 0unsub()