MCPcopy
hub / github.com/pmndrs/zustand / createStore

Function createStore

tests/persistAsync.test.tsx:150–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148 const { storage, setItemSpy } = createPersistantStore(null)
149
150 const createStore = () => {
151 const onRehydrateStorageSpy = vi.fn()
152 const useBoundStore = create(
153 persist(() => ({ count: 0 }), {
154 name: 'test-storage',
155 storage: createJSONStorage(() => storage),
156 onRehydrateStorage: () => onRehydrateStorageSpy,
157 }),
158 )
159 return { useBoundStore, onRehydrateStorageSpy }
160 }
161
162 // Initialize from empty storage
163 const { useBoundStore, onRehydrateStorageSpy } = createStore()

Callers 1

Calls 1

createJSONStorageFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…