tim-smart / tim-smart/effect-atom

Optimistic Updates

Open
#397 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
792
Forks
49
PR merge metrics
No merged PRs in 30d

Description

I like the reactivity pattern, but can I run a mutation that may return the same shape as some query and just bypass the query fetching call?

Basically:

getUser RPC returns User
updateUser RPC returns User

I want to just update instead of invalidate and refetch without having to sync another atom.

I'm used to TanStack query and want to try this but want Stale Queries and Optimistic Updates

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the existing query and mutation behavior described in this issue, including how query fetching and invalidation currently work. Determine the intended behavior for a mutation returning the same shape as a query, including optimistic updates and stale-query handling; the issue is done when this flow works without requiring a separate atom.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.