resource() and action() replace 200 lines of Workbox config, IndexedDB schema, and retry logic — with idempotency keys and cross-tab replay locks built in, so a queued mutation runs exactly once. Works with React, Next.js Server Actions, SvelteKit, Vue, React Native, and Tauri/Electron.
import { resource, action } from '@sweidos/eidos'
export const products = resource('/api/products', { offline: true, strategy: 'stale-while-revalidate',})
export const createOrder = action( async (payload: OrderPayload) => { const res = await fetch('/api/orders', { method: 'POST', body: JSON.stringify(payload) }) return res.json() }, { reliability: 'neverLose', name: 'createOrder' },)
const data = await products.json<Product[]>()One config surface for caching, queuing, and replay — with the idempotency, locking, and conflict-resolution guarantees payments and inventory writes need.
Idempotency keys on every retry, Web Locks-coordinated replay across tabs, and queue schema migration — a queued write executes exactly once.
Mutations queue when offline and replay in order once the network returns — with conflict-resolution presets (serverWins, clientWins, merge, custom).
Declare a fetchable endpoint once. Eidos handles caching strategy, freshness, and offline reads automatically.
No hand-written Workbox config. Eidos generates the Service Worker and registers it for you.
cache-first, network-first, and stale-while-revalidate — pick per resource, no boilerplate.
React, Next.js Server Actions, SvelteKit, Vue, React Native, and Tauri/Electron (SQLite-backed queue) — all share the same neverLose guarantees.
Subscribe, route notification clicks, and resubscribe on key rotation — headless and tree-shaken unless imported.
Live queue, cache state, and offline simulation — plus per-item cancel/retry and idempotency-key inspection.
Install @sweidos/eidos and declare your first neverLose action in under five minutes.