tim-smart / tim-smart/effect-atom

refresh fails for withReactivity atoms seeded via initialValues

Open
#358 1 comment 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

To reproduce

it("refreshes after being seeded with an initial value", () => {
  const atom = Atom.make(() => 1).pipe(
    Atom.withReactivity(["counter"]),
    Atom.keepAlive
  )
  const r = Registry.make({
    initialValues: [Atom.initialValue(atom, 0)]
  })
  assert.strictEqual(r.get(atom), 0)
  r.refresh(atom)
  assert.strictEqual(r.get(atom), 1)
})

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 with the TypeScript reproduction in the issue and trace Registry.make with initialValues, Atom.initialValue, Atom.withReactivity, and Registry.refresh. Run the reproduction, then confirm that refreshing the seeded atom changes its value from 0 to 1 as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.