MCPcopy Create free account
hub / github.com/tinyplex/tinybase / useSetCallback

Function useSetCallback

docs/pseudo.esm.sh/tinybase@9.0.0/ui-react/index.js:361–385  ·  view source on GitHub ↗
(storeOrQueries, settable, get, getDeps = EMPTY_ARRAY, then = getUndefined, thenDeps = EMPTY_ARRAY, methodPrefix, ...args)

Source from the content-addressed store, hash-verified

359 [thing, listenable, ...preArgs, ...listenerDeps, ...postArgs]
360);
361var useSetCallback = (storeOrQueries, settable, get, getDeps = EMPTY_ARRAY, then = getUndefined, thenDeps = EMPTY_ARRAY, methodPrefix, ...args) => useCallback(
362 (parameter) => ifNotUndefined(
363 storeOrQueries,
364 (obj) => ifNotUndefined(
365 get(parameter, obj),
366 (thing) => then(
367 obj[methodPrefix + settable](
368 ...argsOrGetArgs(args, obj, parameter),
369 thing
370 ),
371 thing
372 )
373 )
374 ),
375 /* eslint-disable react-hooks/exhaustive-deps */
376 [
377 storeOrQueries,
378 settable,
379 ...getDeps,
380 ...thenDeps,
381 methodPrefix,
382 ...nonFunctionDeps(args)
383 ]
384 /* eslint-enable react-hooks/exhaustive-deps */
385);
386var useStoreSetCallback = (storeOrStoreId, settable, get, getDeps, then, thenDeps, ...args) => useSetCallback(
387 useStoreOrStoreById(storeOrStoreId),
388 settable,

Callers 2

useStoreSetCallbackFunction · 0.70
useQueriesSetCallbackFunction · 0.70

Calls 2

argsOrGetArgsFunction · 0.70
nonFunctionDepsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…