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

Function useProvideThing

src/ui-solid/context.ts:139–151  ·  view source on GitHub ↗
(
  thingId: Id,
  thing: ThingsByOffset[Offset],
  offset: Offset,
)

Source from the content-addressed store, hash-verified

137};
138
139export const useProvideThing = <Offset extends Offsets>(
140 thingId: Id,
141 thing: ThingsByOffset[Offset],
142 offset: Offset,
143): void => {
144 const contextValue = useContext(Context)?.value ?? EMPTY_CONTEXT;
145 createRenderEffect(() => {
146 const {16: addExtraThingById, 17: delExtraThingById} =
147 untrack(contextValue);
148 addExtraThingById?.(offset, thingId, thing);
149 onCleanup(() => delExtraThingById?.(offset, thingId));
150 });
151};
152
153export const useThingIds = (offset: Offsets): Accessor<Ids> => {
154 const contextValue = useContext(Context)?.value ?? EMPTY_CONTEXT;

Callers 8

useProvideStoreFunction · 0.90
useProvideMetricsFunction · 0.90
useProvideIndexesFunction · 0.90
useProvideRelationshipsFunction · 0.90
useProvideQueriesFunction · 0.90
useProvideCheckpointsFunction · 0.90
useProvidePersisterFunction · 0.90
useProvideSynchronizerFunction · 0.90

Calls 2

addExtraThingByIdFunction · 0.70
delExtraThingByIdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…