CreateStoreType

Interface representing the data structure of thecreateStore()method's output.

src/types.ts
import type { UseBoundStore } from 'zustand'
 import type {
  StoreApiWithPersist,
  StoreApiWithSubscribeWithSelector,
} from 'zustand/middleware'

type CreateStoreType<StoreDataType> = UseBoundStore<
  StoreType<StoreDataType>
> & {
  persist?: StoreApiWithPersist<StoreType<StoreDataType>>['persist']
  subscribeWithSelector?: StoreApiWithSubscribeWithSelector<
    StoreType<StoreDataType>
  >['subscribe']
}
Unexpected error with integration github-files: Integration is not authenticated with GitHub

API reference

The following elements are provided on top of the regular ones returned by zustand's createStore().

persist

The detailed API reference is available here:

subscribeWithSelector

It uses the exact same API as the new subscribeWithSelector() middleware introduced with zustand 3.6.0. The only difference is that zfy allows you to plug it in by simply adding a boolean to createStore() 3rd (options) argument.

The detailed API reference is available here:

Unexpected error with integration github-files: Integration is not authenticated with GitHub

Last updated

Was this helpful?