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

Function setCellIntoNewRow

src/store/index.ts:788–817  ·  view source on GitHub ↗
(
    tableId: Id,
    tableMap: TableMap,
    rowId: Id,
    cellId: Id,
    validCell: Cell,
    skipMiddleware?: boolean,
  )

Source from the content-addressed store, hash-verified

786 );
787
788 const setCellIntoNewRow = (
789 tableId: Id,
790 tableMap: TableMap,
791 rowId: Id,
792 cellId: Id,
793 validCell: Cell,
794 skipMiddleware?: boolean,
795 ): void =>
796 ifNotUndefined(
797 mapGet(tableMap, rowId),
798 (rowMap): any =>
799 setValidCell(tableId, rowId, rowMap, cellId, validCell, skipMiddleware),
800 () => {
801 const rowMap: RowMap = mapNew();
802 mapSet(tableMap, rowId, rowMap);
803 rowIdsChanged(tableId, rowId, 1);
804 objMap(
805 addDefaultsToRow({[cellId]: validCell}, tableId, rowId),
806 (cell, cellId) =>
807 setValidCell(
808 tableId,
809 rowId,
810 rowMap,
811 cellId,
812 cell as Cell,
813 skipMiddleware,
814 ),
815 );
816 },
817 );
818
819 const setValidValues = (
820 values: Values,

Callers 2

setPartialRowFunction · 0.70
setCellFunction · 0.70

Calls 7

mapGetFunction · 0.90
mapNewFunction · 0.90
mapSetFunction · 0.90
objMapFunction · 0.90
setValidCellFunction · 0.70
rowIdsChangedFunction · 0.70
addDefaultsToRowFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…