MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / useStore

Function useStore

zustand-test/src/myZustand.js:42–48  ·  view source on GitHub ↗
(api, selector)

Source from the content-addressed store, hash-verified

40}
41
42function useStore(api, selector) {
43 function getState() {
44 return selector(api.getState());
45 }
46
47 return useSyncExternalStore(api.subscribe, getState)
48}
49
50export const create = (createState) => {
51 const api = createStore(createState)

Callers 3

useBoundStoreFunction · 0.70
AaaFunction · 0.50
BbbFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected