tim-smart / tim-smart/effect-atom

Ability to disable/enable query in `useAtom...` hooks

Open
#339 2 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 have two queries from AtomHttpApi the second one depending on the result of the first one. In TanStack query we have the ability to declaratively enable/disable a query by simply passing a boolean { enabled: firstQueryResult } to the options of the hook making sure that the second one only fires when the result of the first one is truthy. It would be nice for useAtom... hooks to support the same thing.

Link to the TanStack query docs for this pattern

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 locating the useAtom... hooks and their AtomHttpApi query options, then compare the requested behavior with the linked TanStack Query dependent-queries guidance. Check how query execution is currently triggered and identify the relevant tests or test entry points. Done means callers can declaratively control whether a query fires with an enabled boolean, including when it depends on another query's result.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.