Compare commits

...

7 Commits

Author SHA1 Message Date
Danilo Britto
2a419514d1
Update Dependabot configuration for Docker (#3272)
Removed weekly Docker dependency update schedule.
2025-10-20 08:37:17 -05:00
Danilo Britto
5ca9535785
feat: add support for depandabot (#3269) 2025-10-18 07:56:34 -05:00
Wonsuk Choi
d0a1cae750
ci(.github/workflows): update 'actions/setup-node' to v6 (#3267) 2025-10-18 07:43:57 -05:00
Danilo Britto
4269eeef80
Remove codesandbox refs (#3265) 2025-10-17 16:25:20 -05:00
Danilo Britto
60364224be
docs: remove codesandbox refs (#3264)
* Remove codesandbox refs

Updated section title and modified demo links.

* Remove codesandbox refs

* Remove codesandbox refs

* Remove codesandbox refs

* Reorganize demo links in testing documentation

Moved demo links to a new section for better organization.

* Update demo links format in immer-middleware.md

* feat: update format
2025-10-17 09:27:15 -05:00
Danilo Britto
a5ffe1b99b
Update connect-to-state-with-url-hash.md (#3263) 2025-10-17 08:59:04 -05:00
Danilo Britto
d5105b1e13
Update demo link and section title in guide (#3262) 2025-10-17 07:42:04 -05:00
14 changed files with 35 additions and 23 deletions

11
.github/depandabot.yml vendored Normal file
View File

@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'

View File

@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'pnpm'

View File

@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'pnpm'

View File

@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'

View File

@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'pnpm'

View File

@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'pnpm'

View File

@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'pnpm'

View File

@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'pnpm'

View File

@ -43,10 +43,6 @@ export const useBoundStore = create(
)
```
### CodeSandbox Demo
https://codesandbox.io/s/zustand-state-with-url-hash-demo-f29b88?file=/src/store/index.ts
## Persist and Connect State with URL Parameters (Example: URL Query Parameters)
There are times when you want to conditionally connect the state to the URL.
@ -150,3 +146,8 @@ export const buildShareableUrl = (params, version) => {
The generated URL would look like (here without any encoding, for readability):
`https://localhost/search?fishAndBearsStore={"state":{"typesOfFish":["tilapia","salmon"],"numberOfBears":15},"version":0}}`
### Demo
- Hash: https://stackblitz.com/edit/vitejs-vite-9vg24prg
- Query: https://stackblitz.com/edit/vitejs-vite-hyc97ynf

View File

@ -39,7 +39,7 @@ export const create = (<T>() => {
}) as typeof actualCreate
```
## CodeSandbox Demo
## Demo
- Basic: https://stackblitz.com/edit/zustand-how-to-reset-state-basic
- Advanced: https://stackblitz.com/edit/zustand-how-to-reset-state-advanced

View File

@ -110,6 +110,6 @@ Provide type hints when initializing empty Maps and Sets:
Without type hints, TypeScript infers `never[]` which prevents adding items later.
## CodeSandbox Demo
## Demos
Basic: https://stackblitz.com/edit/vitejs-vite-5cu5ddvx

View File

@ -507,11 +507,6 @@ const renderCounterWithContext = () => {
> **Note**: without [globals configuration](https://vitest.dev/config/#globals) enabled, we need
> to add `import { describe, test, expect } from 'vitest'` at the top of each test file.
**CodeSandbox Demos**
- Jest Demo: https://stackblitz.com/edit/jest-zustand
- Vitest Demo: https://stackblitz.com/edit/vitest-zustand
### Testing Stores
In the next examples we are going to use `useCounterStore`
@ -747,3 +742,8 @@ const renderCounterWithContext = (store) => {
functions are built on top of `react-test-renderer`.
- **Testing Implementation Details**: Blog post by Kent C. Dodds on why he recommends to avoid
[testing implementation details](https://kentcdodds.com/blog/testing-implementation-details).
## Demos
- Jest: https://stackblitz.com/edit/jest-zustand
- Vitest: https://stackblitz.com/edit/vitest-zustand

View File

@ -136,6 +136,6 @@ You can also use [Ramda](https://ramdajs.com/):
Both ramda and optics-ts also work with types.
### CodeSandbox Demo
### Demo
https://codesandbox.io/s/zustand-normal-immer-optics-ramda-updating-ynn3o?file=/src/App.tsx
https://stackblitz.com/edit/vitejs-vite-j6bjdygu

View File

@ -123,7 +123,7 @@ so since both the current state and the next state are
equal (if you don't do it correctly),
Zustand will skip calling the subscriptions.
## CodeSandbox Demo
## Demos
- [Basic](https://codesandbox.io/p/sandbox/zustand-updating-draft-states-basic-demo-forked-96mkdw),
- [Advanced](https://codesandbox.io/p/sandbox/zustand-updating-draft-states-advanced-demo-forked-phkzzg).
- Basic: https://stackblitz.com/edit/vitejs-vite-3sgc4ejy
- Advanced: https://stackblitz.com/edit/vitejs-vite-jxxtuyj3