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

Function getThing

src/ui-svelte/functions.svelte.ts:187–199  ·  view source on GitHub ↗
(
  contextValue: ContextValue,
  thingOrThingId: UsedThing | Id | undefined,
  offset: number,
)

Source from the content-addressed store, hash-verified

185 getContext(TINYBASE_CONTEXT_KEY) ?? [];
186
187const getThing = <UsedThing extends Thing>(
188 contextValue: ContextValue,
189 thingOrThingId: UsedThing | Id | undefined,
190 offset: number,
191): UsedThing | undefined =>
192 isUndefined(thingOrThingId)
193 ? (contextValue[offset * 2] as UsedThing | undefined)
194 : isString(thingOrThingId)
195 ? (objGet(
196 contextValue[offset * 2 + 1] as IdObj<UsedThing>,
197 thingOrThingId,
198 ) as UsedThing | undefined)
199 : (thingOrThingId as UsedThing);
200
201const getProvidedThing = <UsedThing extends Thing>(
202 thingOrThingId: UsedThing | Id | undefined,

Callers 4

getProvidedThingFunction · 0.70
resolveProvidedThingFunction · 0.70
createListenableFunction · 0.70
addListenerEffectFunction · 0.70

Calls 3

isUndefinedFunction · 0.90
isStringFunction · 0.90
objGetFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…