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

Function createStore

tests/persistSync.test.tsx:101–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99 const { storage, setItemSpy } = createPersistentStore(null)
100
101 const createStore = () => {
102 const onRehydrateStorageSpy = vi.fn()
103 const useBoundStore = create(
104 persist(() => ({ count: 0 }), {
105 name: 'test-storage',
106 storage: createJSONStorage(() => storage),
107 onRehydrateStorage: () => onRehydrateStorageSpy,
108 }),
109 )
110 return { useBoundStore, onRehydrateStorageSpy }
111 }
112
113 // Initialize from empty storage
114 const { useBoundStore, onRehydrateStorageSpy } = createStore()

Callers 8

createImplFunction · 0.90
createWithEqualityFnImplFunction · 0.90
immer.test.tsxFile · 0.70
devtools.test.tsxFile · 0.70
basic.test.tsFile · 0.50
subscribe.test.tsxFile · 0.50

Calls 1

createJSONStorageFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…