Skip to content

v2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 10 Dec 03:24
c2bc4fb

Major Changes

  • 9d58ece: ## Breaking Changes

    New Unified API

    The library now uses a unified create function with subpath exports instead of separate createWithSignal and createWithStore functions.

    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 → Use import { create } from 'solid-zustand'
    • createWithStore → Use import { create } from 'solid-zustand/store'

    These will be removed in a future major version.