Skip to content
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

[Release] Version packages #93

Merged
merged 1 commit into from
Jan 5, 2025
Merged

[Release] Version packages #93

merged 1 commit into from
Jan 5, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 5, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[email protected]

Major Changes

  • #92 by @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.

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

      or

      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.

      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:

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

@zbeyens zbeyens merged commit fd4b351 into main Jan 5, 2025
@zbeyens zbeyens deleted the changeset-release/main branch January 5, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant