-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist documentation for Map & Set add storage and retrieval of version #2692
Conversation
--HG-- branch : discussion-2689-persist-doc-map-and-set-missing-version
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening up a PR! I think a small change is required. Thanks.
return { | ||
state: { | ||
...state, | ||
transactions: new Map(state.transactions), | ||
}, | ||
version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes version: undefined
if version is undefined. We also need to use object spread here like setItem
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed another commit switching this as you've suggested.
…n only when present by way of spread operator on existingValue --HG-- branch : discussion-2689-persist-doc-map-and-set-missing-version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for your contribution.
--HG--
branch : discussion-2689-persist-doc-map-and-set-missing-version
Related Bug Reports or Discussions
Fixes # Discussion 2689
Summary
Fixes getItem and setItem on the storage for the Map & Set persist example, so that respectfully those methods retrieves and sets the version when present.
Check List
pnpm run prettier
for formatting code and docs