MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / useStore

Function useStore

ui/src/live/createLiveStore.ts:133–139  ·  view source on GitHub ↗
(selector: (s: S) => T)

Source from the content-addressed store, hash-verified

131 }
132
133 function useStore<T>(selector: (s: S) => T): T {
134 useEffect(() => {
135 bumpRef(1)
136 return () => bumpRef(-1)
137 }, [])
138 return useZustandStore(inner, selector)
139 }
140
141 function subscribe(listener: (s: S) => void): () => void {
142 bumpRef(1)

Callers

nothing calls this directly

Calls 1

bumpRefFunction · 0.85

Tested by

no test coverage detected