MCPcopy Index your code
hub / github.com/tinyplex/tinybase / useThing

Function useThing

docs/pseudo.esm.sh/tinybase@9.0.0/ui-react/index.js:126–129  ·  view source on GitHub ↗
(id, offset)

Source from the content-addressed store, hash-verified

124 GLOBAL[TINYBASE_CONTEXT]
125) : GLOBAL[TINYBASE_CONTEXT] = createContext([]);
126var useThing = (id, offset) => {
127 const contextValue = useContext(Context);
128 return isUndefined(id) ? contextValue[offset * 2] : isString(id) ? objGet(contextValue[offset * 2 + 1], id) : id;
129};
130var useThings = (offset) => ({ ...useContext(Context)[offset * 2 + 1] });
131var useThingOrThingById = (thingOrThingId, offset) => {
132 const thing = useThing(thingOrThingId, offset);

Callers 9

useThingOrThingByIdFunction · 0.70
useStoreFunction · 0.70
useMetricsFunction · 0.70
useIndexesFunction · 0.70
useRelationshipsFunction · 0.70
useQueriesFunction · 0.70
useCheckpointsFunction · 0.70
usePersisterFunction · 0.70
useSynchronizerFunction · 0.70

Calls 3

isUndefinedFunction · 0.70
isStringFunction · 0.70
objGetFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…