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

Function setValidCell

src/store/index.ts:759–786  ·  view source on GitHub ↗
(
    tableId: Id,
    rowId: Id,
    rowMap: RowMap,
    cellId: Id,
    cell: Cell,
    skipMiddleware?: boolean,
  )

Source from the content-addressed store, hash-verified

757 };
758
759 const setValidCell = (
760 tableId: Id,
761 rowId: Id,
762 rowMap: RowMap,
763 cellId: Id,
764 cell: Cell,
765 skipMiddleware?: boolean,
766 ): void =>
767 ifTransformed(
768 cell,
769 () =>
770 ifNotUndefined(
771 skipMiddleware ? undefined : middleware[4],
772 (willSetCell) =>
773 whileMutating(() => willSetCell(tableId, rowId, cellId, cell)),
774 () => cell,
775 ),
776 (cell) => {
777 if (!collHas(rowMap, cellId)) {
778 cellIdsChanged(tableId, rowId, cellId, 1);
779 }
780 const oldCell = mapGet(rowMap, cellId);
781 if (cell !== oldCell) {
782 cellChanged(tableId, rowId, cellId, oldCell, cell);
783 mapSet(rowMap, cellId, cell);
784 }
785 },
786 );
787
788 const setCellIntoNewRow = (
789 tableId: Id,

Callers 4

setValidRowFunction · 0.70
applyRowDirectlyFunction · 0.70
setCellIntoNewRowFunction · 0.70
delValidCellFunction · 0.70

Calls 8

collHasFunction · 0.90
mapGetFunction · 0.90
mapSetFunction · 0.90
ifTransformedFunction · 0.70
whileMutatingFunction · 0.70
cellIdsChangedFunction · 0.70
cellChangedFunction · 0.70
willSetCellFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…