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

Function useAddRowCallback

docs/pseudo.esm.sh/tinybase@9.0.0/ui-solid/index.js:543–560  ·  view source on GitHub ↗
(tableId, getRow, storeOrStoreId, then = getUndefined, reuseRowIds = true)

Source from the content-addressed store, hash-verified

541var useSetTableCallback = (tableId, getTable, storeOrStoreId, then) => useStoreSetCallback(storeOrStoreId, TABLE, getTable, then, tableId);
542var useSetRowCallback = (tableId, rowId, getRow, storeOrStoreId, then) => useStoreSetCallback(storeOrStoreId, ROW, getRow, then, tableId, rowId);
543var useAddRowCallback = (tableId, getRow, storeOrStoreId, then = getUndefined, reuseRowIds = true) => {
544 const store = useStoreOrStoreById(storeOrStoreId);
545 return (parameter) => ifNotUndefined(
546 getThing(store),
547 (resolvedStore) => ifNotUndefined(
548 getRow(parameter, resolvedStore),
549 (row) => then(
550 resolvedStore.addRow(
551 isFunction(tableId) ? tableId(parameter, resolvedStore) : tableId,
552 row,
553 reuseRowIds
554 ),
555 resolvedStore,
556 row
557 )
558 )
559 );
560};
561var useSetPartialRowCallback = (tableId, rowId, getPartialRow, storeOrStoreId, then) => useStoreSetCallback(
562 storeOrStoreId,
563 PARTIAL + ROW,

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…