Skip to content

Commit 87a5b50

Browse files
Version Packages
1 parent eefe25a commit 87a5b50

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

.changeset/pink-guests-jump.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/zustand-x/CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# @udecode/zustood
22

3+
## 6.2.0
4+
5+
### Minor Changes
6+
7+
- [#117](https://github.com/udecode/zustand-x/pull/117) by [@felixfeng33](https://github.com/felixfeng33)
8+
9+
- Introduced a React-free `createVanillaStore` in `zustand-x/vanilla` using `zustand/vanilla`.
10+
- Extracted shared internal logic (`middleware`, `options parsing`, `selector/action helpers`) to `src/internal` for reuse.
11+
- Refactored React entry (`createStore`, hooks) to use shared internal logic without breaking existing API.
12+
- Split types: base hook-free definitions vs React-specific types for compatibility with both entries.
13+
- Updated package exports to include `./vanilla` while keeping `.` for React.
14+
- Added vanilla-focused tests to ensure store functionality works without React.
15+
- Ensured middleware, selector/action extensions, and mutative utilities work in both vanilla and React contexts.
16+
- **Example usage (vanilla, no React):**
17+
18+
```ts
19+
import { createVanillaStore } from 'zustand-x/vanilla';
20+
21+
const counterStore = createVanillaStore(
22+
{ count: 0 },
23+
{ name: 'vanilla-counter', persist: true }
24+
)
25+
.extendSelectors(({ get }) => ({
26+
doubled: () => get('count') * 2,
27+
}))
28+
.extendActions(({ set }) => ({
29+
increment: () => set('count', (value) => value + 1),
30+
}));
31+
32+
counterStore.actions.increment();
33+
console.log(counterStore.get('doubled')); // 2
34+
```
35+
336
## 6.1.2
437

538
### Patch Changes

packages/zustand-x/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zustand-x",
3-
"version": "6.1.2",
3+
"version": "6.2.0",
44
"description": "Zustand store factory for a best-in-class developer experience.",
55
"license": "MIT",
66
"homepage": "https://zustand-x.udecode.dev",

0 commit comments

Comments
 (0)