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

Function useSetCallback

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

Source from the content-addressed store, hash-verified

441 return useSyncExternalStore2(subscribe, getResult, getResult);
442};
443var useSetCallback = (storeOrQueries, settable, get, getDeps = EMPTY_ARRAY2, then = getUndefined, thenDeps = EMPTY_ARRAY2, methodPrefix, ...args) => useCallback2(
444 (parameter) => ifNotUndefined2(
445 storeOrQueries,
446 (obj) => ifNotUndefined2(
447 get(parameter, obj),
448 (thing) => then(
449 obj[methodPrefix + settable](
450 ...argsOrGetArgs(args, obj, parameter),
451 thing
452 ),
453 thing
454 )
455 )
456 ),
457 /* eslint-disable react-hooks/exhaustive-deps */
458 [
459 storeOrQueries,
460 settable,
461 ...getDeps,
462 ...thenDeps,
463 methodPrefix,
464 ...nonFunctionDeps(args)
465 ]
466 /* eslint-enable react-hooks/exhaustive-deps */
467);
468var useStoreSetCallback = (storeOrStoreId, settable, get, getDeps, then, thenDeps, ...args) => useSetCallback(
469 useStoreOrStoreById2(storeOrStoreId),
470 settable,

Callers 1

useStoreSetCallbackFunction · 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…