How do I type the persist
middleware StorePersist
type?
#2871
-
Originally I had: import type { StoreApi } from 'zustand'
...
export const createMyStore = (customParams: MyParams): StoreApi<MyStore> => {
return createStore<MyStore>()(
...
)
} And now I am trying to add the import type { StoreApi } from 'zustand'
...
export const createMyStore = (customParams: MyParams): StoreApi<MyStore> => {
return createStore<MyStore>()(
persist(
...
)
)
} But And I see the store type is now defined as but I am on zustand version 4.5.2. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
@JDaoMothership https://zustand.docs.pmnd.rs/guides/typescript#create-without-curried-workaround |
Beta Was this translation helpful? Give feedback.
-
Answer from @dbritto-dev here: #2871 (reply in thread)
|
Beta Was this translation helpful? Give feedback.
Answer from @dbritto-dev here: #2871 (reply in thread)