solidjs-community / solidjs-community/solid-primitives
Can't add new keys to persisted stores - feature request for different defaults handing
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.