Skip to content

Commit

Permalink
Merge pull request #93 from udecode/changeset-release/main
Browse files Browse the repository at this point in the history
[Release] Version packages
  • Loading branch information
zbeyens authored Jan 5, 2025
2 parents 91f56e1 + 54251ab commit fd4b351
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 71 deletions.
70 changes: 0 additions & 70 deletions .changeset/shy-bats-drop.md

This file was deleted.

74 changes: 74 additions & 0 deletions packages/zustand-x/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
# @udecode/zustood

## 5.0.0

### Major Changes

- [#92](https://github.com/udecode/zustand-x/pull/92) by [@imarabinda](https://github.com/imarabinda)

- Added support for Zustand 4.5.0+.
- `mutative` support. Pass `mutative: true` in the options.

## Migration Instructions

Update the Store Initialization:

1. Replace the old method of initializing the store with the new API.

```tsx
const store = createStore(
() => ({
name: 'zustandX',
stars: 0,
}),
{
name: 'repo',
immer: true,
}
);
```

or

```tsx
const store = createStore(
{
name: 'zustandX',
stars: 0,
},
{
name: 'repo',
immer: true,
}
);
```

2. Ensure to pass the configuration object with name and other options as needed.
3. If your application relies on immer, enable it by passing immer: true in the configuration object.

```tsx
const store = createStore(
() => ({
name: 'zustandX',
stars: 0,
}),
{
name: 'repo',
immer: true,
}
);
```

4. With the new version, integrating middlewares has also changed. Here's how to upgrade your middleware usage:

```tsx
const store = createStore(
middlewareWrapHere(() => ({
name: 'zustandX',
stars: 0,
})),
{
name: 'repo',
immer: true,
}
);
```

## 3.0.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/zustand-x/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zustand-x",
"version": "4.0.0",
"version": "5.0.0",
"description": "Zustand store factory for a best-in-class developer experience.",
"license": "MIT",
"homepage": "https://zustand-x.udecode.dev",
Expand Down

0 comments on commit fd4b351

Please sign in to comment.