Major Changes
-
9d58ece: ## Breaking Changes
New Unified API
The library now uses a unified
createfunction with subpath exports instead of separatecreateWithSignalandcreateWithStorefunctions.Before:
import { createWithSignal } from "solid-zustand"; // signal-based import { createWithStore } from "solid-zustand"; // store-based
After:
import { create } from "solid-zustand"; // signal-based (default) import { create } from "solid-zustand/store"; // store-based
Requirements
⚠️ Requires zustand v5 or higher.Migration Guide
Using
createWithSignal:- import { createWithSignal } from 'solid-zustand' + import { create } from 'solid-zustand' - const useStore = createWithSignal((set) => ({ ... })) + const useStore = create((set) => ({ ... }))
Using
createWithStore:- import { createWithStore } from 'solid-zustand' + import { create } from 'solid-zustand/store' - const useStore = createWithStore((set) => ({ ... })) + const useStore = create((set) => ({ ... }))
Using default export:
- import create from 'solid-zustand' + import { create } from 'solid-zustand' - const useStore = create((set) => ({ ... })) + const useStore = create((set) => ({ ... }))
Deprecated APIs
The following exports are deprecated but still work:
createWithSignal→ Useimport { create } from 'solid-zustand'createWithStore→ Useimport { create } from 'solid-zustand/store'
These will be removed in a future major version.