docs: Update typescript guide persist examples...#2001
Merged
dai-shi merged 7 commits intopmndrs:mainfrom Aug 25, 2023
Merged
Conversation
|
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. Latest deployment of this branch, based on commit ba7d7dd:
|
Member
|
Please run prettier. |
2fb9d8e to
335360b
Compare
Member
|
guides/testing.md should be reverted. |
Contributor
Author
|
reverted guides/testing.md |
dai-shi
approved these changes
Aug 22, 2023
Member
dai-shi
left a comment
There was a problem hiding this comment.
Thanks for your contribution.
sewera
suggested changes
Aug 23, 2023
Co-authored-by: Blazej Sewera <code@sewera.dev>
… conventions. Co-authored-by: Blazej Sewera <code@sewera.dev>
Contributor
Author
|
the name property on the PersistOptions parameter is required. { name:
'name' } might be better but it is there because if you don't include it
you get an error.
if you want to pick a different value like please make a suggestion. i
have no opinion either way just needs to be a value.
thanks,
John
…On Wed, Aug 23, 2023 at 5:24 PM Blazej Sewera ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/guides/typescript.md
<#2001 (comment)>:
> @@ -190,7 +193,7 @@ Just make sure you are using them immediately inside `create` so as to make the
import { create } from 'zustand'
import { devtools, persist } from 'zustand/middleware'
-const myMiddlewares = (f) => devtools(persist(f))
+const myMiddlewares = (f) => devtools(persist(f, { name: 'options name' }))
Why is 'options name' here? What does it mean?
—
Reply to this email directly, view it on GitHub
<#2001 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQH3XDOA5DLA6M6DT4DBDXW2GMTANCNFSM6AAAAAA3WD64ZU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
john gilliland
resume <http://resume.johng.info>| github <https://github.com/elusive> |
l/in <http://www.linkedin.com/in/johncgilliland/> | pgp
<https://www.dropbox.com/s/f7myckrtvakms84/John_C._Gilliland_pub.asc?dl=0>
|
Collaborator
|
I suggest |
|
Thanks you guys, let me check later
…On Thu, Aug 24, 2023 at 2:16 PM Blazej Sewera ***@***.***> wrote:
I suggest 'bearStore', because it's its middleware
—
Reply to this email directly, view it on GitHub
<#2001 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOCNUVUIGDDBL2SP7EKCJJLXW35TJANCNFSM6AAAAAA3WD64ZU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
added 2 commits
August 24, 2023 19:21
Contributor
Author
|
Updated this last instance of persist options to name: bearStore per
suggestion.
Thanks
John
…On Thu, Aug 24, 2023 at 8:37 AM Maiveasna ***@***.***> wrote:
Thanks you guys, let me check later
On Thu, Aug 24, 2023 at 2:16 PM Blazej Sewera ***@***.***>
wrote:
> I suggest 'bearStore', because it's its middleware
>
> —
> Reply to this email directly, view it on GitHub
> <#2001 (comment)>,
or
> unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AOCNUVUIGDDBL2SP7EKCJJLXW35TJANCNFSM6AAAAAA3WD64ZU>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#2001 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQH3ROC22AHXEP43KV64LXW5RKHANCNFSM6AAAAAA3WD64ZU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
john gilliland
resume <http://resume.johng.info>| github <https://github.com/elusive> |
l/in <http://www.linkedin.com/in/johncgilliland/> | pgp
<https://www.dropbox.com/s/f7myckrtvakms84/John_C._Gilliland_pub.asc?dl=0>
|
sewera
approved these changes
Aug 25, 2023
bodinsamuel
referenced
this pull request
in specfy/specfy
Nov 8, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [zustand](https://togithub.com/pmndrs/zustand) | [`4.4.1` -> `4.4.6`](https://renovatebot.com/diffs/npm/zustand/4.4.1/4.4.6) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pmndrs/zustand (zustand)</summary> ### [`v4.4.6`](https://togithub.com/pmndrs/zustand/releases/tag/v4.4.6) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.4.5...v4.4.6) v4.4.5 has an issue with some TypeScript configs about module resolution. It should be fixed now. Thanks for the patience. #### What's Changed - Update export types by [@​dbritto-dev](https://togithub.com/dbritto-dev) in [https://github.com/pmndrs/zustand/pull/2170](https://togithub.com/pmndrs/zustand/pull/2170) #### New Contributors - [@​cheatkey](https://togithub.com/cheatkey) made their first contribution in [https://github.com/pmndrs/zustand/pull/2147](https://togithub.com/pmndrs/zustand/pull/2147) - [@​frixaco](https://togithub.com/frixaco) made their first contribution in [https://github.com/pmndrs/zustand/pull/2166](https://togithub.com/pmndrs/zustand/pull/2166) **Full Changelog**: pmndrs/zustand@v4.4.5...v4.4.6 ### [`v4.4.5`](https://togithub.com/pmndrs/zustand/releases/tag/v4.4.5) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.4.4...v4.4.5) Hopefully, it should fix some issues with Node.js environment including Next.js. #### What's Changed - fix: importing CJS React in ESM by [@​dai-shi](https://togithub.com/dai-shi) in [https://github.com/pmndrs/zustand/pull/2154](https://togithub.com/pmndrs/zustand/pull/2154) - Apply publint recommendations by [@​dbritto-dev](https://togithub.com/dbritto-dev) in [https://github.com/pmndrs/zustand/pull/2157](https://togithub.com/pmndrs/zustand/pull/2157) #### New Contributors - [@​plrs9816](https://togithub.com/plrs9816) made their first contribution in [https://github.com/pmndrs/zustand/pull/2137](https://togithub.com/pmndrs/zustand/pull/2137) - [@​Brammm](https://togithub.com/Brammm) made their first contribution in [https://github.com/pmndrs/zustand/pull/2139](https://togithub.com/pmndrs/zustand/pull/2139) - [@​sobies93](https://togithub.com/sobies93) made their first contribution in [https://github.com/pmndrs/zustand/pull/2142](https://togithub.com/pmndrs/zustand/pull/2142) **Full Changelog**: pmndrs/zustand@v4.4.4...v4.4.5 ### [`v4.4.4`](https://togithub.com/pmndrs/zustand/releases/tag/v4.4.4) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.4.3...v4.4.4) There was a tiny issue in v4.4.3, which broke with some bundlers, which this version fixes. #### What's Changed - fix(build): patch entry points zustand/shallow for CJS by [@​dai-shi](https://togithub.com/dai-shi) in [https://github.com/pmndrs/zustand/pull/2128](https://togithub.com/pmndrs/zustand/pull/2128) **Full Changelog**: pmndrs/zustand@v4.4.3...v4.4.4 ### [`v4.4.3`](https://togithub.com/pmndrs/zustand/releases/tag/v4.4.3) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.4.2...v4.4.3) The changes in v4.4.2 were troublesome for some users. This version should fix/mitigate such cases. #### What's Changed - fix(shallow): Extract shallow vanilla and react by [@​dbritto-dev](https://togithub.com/dbritto-dev) in [https://github.com/pmndrs/zustand/pull/2097](https://togithub.com/pmndrs/zustand/pull/2097) - fix(types): mitigate devtools typing by [@​dai-shi](https://togithub.com/dai-shi) in [https://github.com/pmndrs/zustand/pull/2099](https://togithub.com/pmndrs/zustand/pull/2099) **Full Changelog**: pmndrs/zustand@v4.4.2...v4.4.3 ### [`v4.4.2`](https://togithub.com/pmndrs/zustand/releases/tag/v4.4.2) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.4.1...v4.4.2) This adds `useShallow` hook to cover some use cases that are deprecated with v4.4.0 change. Check out [the guide](https://togithub.com/pmndrs/zustand/blob/ec538e9d4c0b9b5759e6dfd0fd3c9a21f8236949/docs/guides/prevent-rerenders-with-use-shallow.md). ##### Migration Guide [#​1991](https://togithub.com/pmndrs/zustand/issues/1991) requires something like below if you are using the `devtools` middleware *and* TypeScript. ```diff import { devtools } from 'zustand/middleware' + import type {} from '@​redux-devtools/extension' ``` ##### What's Changed - fix(types)(middleware/devtools): avoid copying types by [@​dai-shi](https://togithub.com/dai-shi) in [https://github.com/pmndrs/zustand/pull/1991](https://togithub.com/pmndrs/zustand/pull/1991) - fix(traditional): make defaultEqualityFn optional in TS Types by [@​charkour](https://togithub.com/charkour) in [https://github.com/pmndrs/zustand/pull/2060](https://togithub.com/pmndrs/zustand/pull/2060) - feat: add useShallow by [@​FaberVitale](https://togithub.com/FaberVitale) in [https://github.com/pmndrs/zustand/pull/2090](https://togithub.com/pmndrs/zustand/pull/2090) ##### New Contributors - [@​aykutkardas](https://togithub.com/aykutkardas) made their first contribution in [https://github.com/pmndrs/zustand/pull/1993](https://togithub.com/pmndrs/zustand/pull/1993) - [@​michelts](https://togithub.com/michelts) made their first contribution in [https://github.com/pmndrs/zustand/pull/1997](https://togithub.com/pmndrs/zustand/pull/1997) - [@​elusive](https://togithub.com/elusive) made their first contribution in [https://github.com/pmndrs/zustand/pull/2001](https://togithub.com/pmndrs/zustand/pull/2001) - [@​mayank1513](https://togithub.com/mayank1513) made their first contribution in [https://github.com/pmndrs/zustand/pull/2015](https://togithub.com/pmndrs/zustand/pull/2015) - [@​fdb](https://togithub.com/fdb) made their first contribution in [https://github.com/pmndrs/zustand/pull/2029](https://togithub.com/pmndrs/zustand/pull/2029) - [@​tmkx](https://togithub.com/tmkx) made their first contribution in [https://github.com/pmndrs/zustand/pull/2032](https://togithub.com/pmndrs/zustand/pull/2032) - [@​OshriAsulin](https://togithub.com/OshriAsulin) made their first contribution in [https://github.com/pmndrs/zustand/pull/2028](https://togithub.com/pmndrs/zustand/pull/2028) - [@​ivanquirino](https://togithub.com/ivanquirino) made their first contribution in [https://github.com/pmndrs/zustand/pull/2047](https://togithub.com/pmndrs/zustand/pull/2047) - [@​stavkamil](https://togithub.com/stavkamil) made their first contribution in [https://github.com/pmndrs/zustand/pull/2071](https://togithub.com/pmndrs/zustand/pull/2071) - [@​NaamuKim](https://togithub.com/NaamuKim) made their first contribution in [https://github.com/pmndrs/zustand/pull/2088](https://togithub.com/pmndrs/zustand/pull/2088) - [@​FaberVitale](https://togithub.com/FaberVitale) made their first contribution in [https://github.com/pmndrs/zustand/pull/2090](https://togithub.com/pmndrs/zustand/pull/2090) **Full Changelog**: pmndrs/zustand@v4.4.1...v4.4.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm every weekday" in timezone Europe/Paris, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/specfy/specfy). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40Ni4wIiwidXBkYXRlZEluVmVyIjoiMzcuNDYuMCIsInRhcmdldEJyYW5jaCI6ImNob3JlL3Jlbm92YXRlQmFzZUJyYW5jaCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...to add required name option.
Summary
The ts example calls to persist fail due to lack of 2nd parameter PersistOptions which has a required value of name. Therefore minimum doc example requires persist calls to provide { name: "req. name" }.
reference: (https://docs.pmnd.rs/zustand/integrations/persisting-store-data)
Check List
yarn run prettierfor formatting code and docs