fate

A modern data client for React.

Search Login
Thinking...

Optimistic actions that roll back cleanly

React Integration
#optimistic-updates
#async-react
👍82 likes

Actions in fate are exposed for useActionState, and mutations can carry an optimistic object alongside the input. The cache applies the optimistic update immediately, re-renders affected views, and rolls the affected records back if the server rejects the mutation. This example uses the like button because it is easy to see, but the same model works for comments and other records.

- Kai

3 Comments

Dina

The useActionState integration is practical because the form code still looks like React instead of a custom mutation framework.

Jamal

The server adapter notes helped me understand why fields and lists can share one selection pipeline.

Lena

The event seed data now looks like something a real project would use for launch planning.

Add a comment