Urgent.News

What's breaking now, across thousands of outlets.

Tech

Offline-First React: TanStack Query + IndexedDB Patterns

Introduction “I added an item in aisle 5, closed the app, and it synced automatically on the bus ride home.” That one sentence describes the behavior users notice and remember: writes that survive crashes, restarts, and flaky networks. This article shows a practical, production-tested 3-step recipe to get durable, replayable optimistic writes using TanStack Query (React Query), Dexie (IndexedDB),…

The article discusses a practical approach to implementing durable, replayable optimistic writes in React applications using TanStack Query (formerly React Query) and IndexedDB (via Dexie). The key steps outlined are persisting the reactive cache to IndexedDB, registering mutation defaults for paused mutations, and using client-generated UUIDs with an outbox replay queue for idempotency and ordering.

The main focus is on treating TanStack Query as a reactive cache over a local DB, ensuring writes survive crashes, restarts, and flaky networks. The article provides a conceptual example of wiring the PersistQueryClientProvider and explains the importance of using stable mutation keys, registering defaults at module load, and persisting only mutations that can be rebuilt.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Our deploys were also our restart policy

At four on a Sunday morning an internal reconciliation service went down. All four pods were killed for memory inside twenty minutes of each other, came back, and were killed again a few hours later.

Integrating UAE Peppol E-Invoicing with Odoo — What Developers and Implementers Need to Know

UAE mandatory e-invoicing went live in pilot phase on 1 July 2026. Every UAE VAT-registered business sending B2B invoices must now route them through the UAE Peppol network as PINT AE XML.

  • UAE launched mandatory e-invoicing system via UAE Peppol network on 1 July 2026
  • Odoo lacks native UAE Peppol integration, requiring custom connector development
  • PINT AE XML schema has 17 mandatory fields, including VAT category codes and UN/CEFACT codes

More from Tuesday 22 September →