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

Function useAddRowCallback

docs/pseudo.esm.sh/tinybase@9.0.0/ui-react/index.js:609–630  ·  view source on GitHub ↗
(tableId, getRow, getRowDeps = EMPTY_ARRAY, storeOrStoreId, then = getUndefined, thenDeps = EMPTY_ARRAY, reuseRowIds = true)

Source from the content-addressed store, hash-verified

607 rowId
608);
609var useAddRowCallback = (tableId, getRow, getRowDeps = EMPTY_ARRAY, storeOrStoreId, then = getUndefined, thenDeps = EMPTY_ARRAY, reuseRowIds = true) => {
610 const store = useStoreOrStoreById(storeOrStoreId);
611 return useCallback(
612 (parameter) => ifNotUndefined(
613 store,
614 (store2) => ifNotUndefined(
615 getRow(parameter, store2),
616 (row) => then(
617 store2.addRow(
618 isFunction(tableId) ? tableId(parameter, store2) : tableId,
619 row,
620 reuseRowIds
621 ),
622 store2,
623 row
624 )
625 )
626 ),
627 // eslint-disable-next-line react-hooks/exhaustive-deps
628 [store, tableId, ...getRowDeps, ...thenDeps, reuseRowIds]
629 );
630};
631var useSetPartialRowCallback = (tableId, rowId, getPartialRow, getPartialRowDeps, storeOrStoreId, then, thenDeps) => useStoreSetCallback(
632 storeOrStoreId,
633 PARTIAL + ROW,

Callers

nothing calls this directly

Calls 5

useStoreOrStoreByIdFunction · 0.70
isFunctionFunction · 0.70
addRowMethod · 0.65
getRowFunction · 0.50
tableIdFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…