mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
chore: fix middleware imports (#2798)
This commit is contained in:
parent
0007ef43a8
commit
cce8d5b22e
@ -57,7 +57,7 @@ don’t need to define them explicitly.
|
||||
|
||||
```ts
|
||||
import { createStore } from 'zustand/vanilla'
|
||||
import { combine } from 'zustand/middleware/combine'
|
||||
import { combine } from 'zustand/middleware'
|
||||
|
||||
const positionStore = createStore(
|
||||
combine({ position: { x: 0, y: 0 } }, (set) => ({
|
||||
|
||||
@ -99,7 +99,7 @@ This example shows you how you can use `Redux Devtools` to debug a Slices patter
|
||||
|
||||
```ts
|
||||
import { create, StateCreator } from 'zustand'
|
||||
import { devtools } from 'zustand/middleware/devtools'
|
||||
import { devtools } from 'zustand/middleware'
|
||||
|
||||
type BearSlice = {
|
||||
bears: number
|
||||
@ -167,7 +167,7 @@ For instance the next example doesn't have action type name:
|
||||
|
||||
```ts
|
||||
import { create, StateCreator } from 'zustand'
|
||||
import { devtools } from 'zustand/middleware/devtools'
|
||||
import { devtools } from 'zustand/middleware'
|
||||
|
||||
type BearSlice = {
|
||||
bears: number
|
||||
|
||||
@ -57,7 +57,7 @@ redux<T, A>(reducerFn: (state: T, action: A) => T, initialState: T): StateCreato
|
||||
|
||||
```ts
|
||||
import { createStore } from 'zustand/vanilla'
|
||||
import { redux } from 'zustand/middleware/redux'
|
||||
import { redux } from 'zustand/middleware'
|
||||
|
||||
type PersonStoreState = {
|
||||
firstName: string
|
||||
|
||||
@ -57,7 +57,7 @@ partial state updates. We can use `subscribe` for external state management.
|
||||
|
||||
```ts
|
||||
import { createStore } from 'zustand/vanilla'
|
||||
import { subscribeWithSelector } from 'zustand/middleware/subscribeWithSelector'
|
||||
import { subscribeWithSelector } from 'zustand/middleware'
|
||||
|
||||
type PositionStoreState = { position: { x: number; y: number } }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user