next-safe-actionplayground
Overview
  • Home
Core
  • Core Actions
  • Validation Errors
  • Middleware
Hooks
  • React Hooks
  • Optimistic Updates
  • Coordinating Mutations
  • Pending Changes
Integrations
  • Form Integration
  • React Hook Form
  • TanStack Query
Framework
  • Navigation & Framework
  • Offline Support
  • GitHub

Coordinating Mutations

useOptimisticStateAction queues overlapping writes and folds every in-flight change over the confirmed state.

Loading items...

Queued Reordering
useOptimisticStateAction: each move renders instantly, saves run one after another, and a rejected move rolls back to the last confirmed order.
  • Design review
  • Ship the changelog
  • Fix the flaky test
  • Update the docs

Each save takes 1.2s. Click several moves quickly: every one shows immediately, and the writes are serialized rather than raced. Idle.

Status:Idle
Last settled result:
{}