MCPcopy Create free account
hub / github.com/GreatStackDev/gocart / StoreProvider

Function StoreProvider

app/StoreProvider.js:6–14  ·  view source on GitHub ↗
({ children })

Source from the content-addressed store, hash-verified

4import { makeStore } from '../lib/store'
5
6export default function StoreProvider({ children }) {
7 const storeRef = useRef(undefined)
8 if (!storeRef.current) {
9 // Create the store instance the first time this renders
10 storeRef.current = makeStore()
11 }
12
13 return <Provider store={storeRef.current}>{children}</Provider>
14}

Callers

nothing calls this directly

Calls 1

makeStoreFunction · 0.90

Tested by

no test coverage detected