solidjs-community / solidjs-community/solid-primitives

Can't add new keys to persisted stores - feature request for different defaults handing

Open
#748 9 comments 0 reactions 1 assignee View on GitHub

@atk is already working on this.

Since Feb 8, 2025.

help wanted
Dominant language
TypeScript
Stars
1.6k
Forks
162
Avg merge
19h 40m
Merged PRs (30d)
8

Description

Describe the bug
  const [,setStore] = makePersisted(createStore({a: 1}), {name: 'x'})
  setStore({a: 2}) // trigger storage (because initial values are not persisted)
  const [store2, setStore2] = makePersisted(createStore({a: 1, b: 1}), {name: 'x'})
  console.log(Object.keys(store2)) // ['a']

I would expect ['a', 'b']

While I'm here: these stores are so useful and convenient! Thanks for this.

Minimal Reproduction Link

https://stackblitz.com/edit/github-cickt7r1?file=src%2Findex.tsx

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.