MCPcopy
hub / github.com/tinyplex/tinybase / useDel

Function useDel

src/ui-react/hooks.ts:549–563  ·  view source on GitHub ↗
(
  storeOrStoreId: StoreOrStoreId | undefined,
  deletable: string,
  then: (store: Store) => void = getUndefined,
  thenDeps: DependencyList = EMPTY_ARRAY,
  ...args: (Id | GetId<Parameter> | boolean | undefined)[]
)

Source from the content-addressed store, hash-verified

547) => arrayFilter(args, (arg) => !isFunction(arg));
548
549const useDel = <Parameter>(
550 storeOrStoreId: StoreOrStoreId | undefined,
551 deletable: string,
552 then: (store: Store) => void = getUndefined,
553 thenDeps: DependencyList = EMPTY_ARRAY,
554 ...args: (Id | GetId<Parameter> | boolean | undefined)[]
555): ParameterizedCallback<Parameter> => {
556 const store: any = useStoreOrStoreById(storeOrStoreId);
557 return useCallback(
558 (parameter?: Parameter) =>
559 then(store?.[DEL + deletable](...argsOrGetArgs(args, store, parameter))),
560 // eslint-disable-next-line react-hooks/exhaustive-deps
561 [store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
562 );
563};
564
565const useCheckpointAction = (
566 checkpointsOrCheckpointsId: CheckpointsOrCheckpointsId | undefined,

Callers 6

useDelTablesCallbackFunction · 0.70
useDelTableCallbackFunction · 0.70
useDelRowCallbackFunction · 0.70
useDelCellCallbackFunction · 0.70
useDelValuesCallbackFunction · 0.70
useDelValueCallbackFunction · 0.70

Calls 3

useStoreOrStoreByIdFunction · 0.90
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…