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

Function Provider

docs/pseudo.esm.sh/tinybase@9.0.0/ui-react/index.js:159–288  ·  view source on GitHub ↗
({
  store,
  storesById,
  metrics,
  metricsById,
  indexes,
  indexesById,
  relationships,
  relationshipsById,
  queries,
  queriesById,
  checkpoints,
  checkpointsById,
  persister,
  persistersById,
  synchronizer,
  synchronizersById,
  children
})

Source from the content-addressed store, hash-verified

157 }
158];
159var Provider = ({
160 store,
161 storesById,
162 metrics,
163 metricsById,
164 indexes,
165 indexesById,
166 relationships,
167 relationshipsById,
168 queries,
169 queriesById,
170 checkpoints,
171 checkpointsById,
172 persister,
173 persistersById,
174 synchronizer,
175 synchronizersById,
176 children
177}) => {
178 const parentValue = useContext(Context);
179 const [extraThingsById, setExtraThingsById] = useState(
180 () => arrayNew(8, () => ({}))
181 );
182 const addExtraThingById = useCallback(
183 (thingOffset, id, thing) => setExtraThingsById(
184 (extraThingsById2) => objGet(extraThingsById2[thingOffset], id) == thing ? extraThingsById2 : arrayWith(extraThingsById2, thingOffset, {
185 ...extraThingsById2[thingOffset],
186 [id]: thing
187 })
188 ),
189 []
190 );
191 const delExtraThingById = useCallback(
192 (thingOffset, id) => setExtraThingsById(
193 (extraThingsById2) => !objHas(extraThingsById2[thingOffset], id) ? extraThingsById2 : arrayWith(
194 extraThingsById2,
195 thingOffset,
196 objDel(extraThingsById2[thingOffset], id)
197 )
198 ),
199 []
200 );
201 return /* @__PURE__ */ jsx(Context.Provider, {
202 value: useMemo(
203 () => [
204 ...mergeParentThings(
205 OFFSET_STORE,
206 parentValue,
207 store,
208 storesById,
209 extraThingsById
210 ),
211 ...mergeParentThings(
212 OFFSET_METRICS,
213 parentValue,
214 metrics,
215 metricsById,
216 extraThingsById

Callers

nothing calls this directly

Calls 6

arrayNewFunction · 0.70
objGetFunction · 0.70
arrayWithFunction · 0.70
objHasFunction · 0.70
objDelFunction · 0.70
mergeParentThingsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…