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

Function processRow

src/common/definable.ts:124–149  ·  view source on GitHub ↗
(rowId: Id)

Source from the content-addressed store, hash-verified

122 const sortKeys = mapGet(allSortKeys, id);
123
124 const processRow = (rowId: Id) => {
125 const getCell = (cellId: Id): Cell | undefined =>
126 store.getCell(tableId, rowId, cellId);
127 const oldRowValue = mapGet(rowValues, rowId);
128 const newRowValue = hasRow(tableId, rowId)
129 ? validateRowValue(getRowValue(getCell as any, rowId))
130 : undefined;
131 if (!(
132 oldRowValue === newRowValue ||
133 (isArray(oldRowValue) &&
134 isArray(newRowValue) &&
135 arrayIsEqual(oldRowValue, newRowValue))
136 )) {
137 mapSet(changedRowValues, rowId, [oldRowValue, newRowValue]);
138 }
139
140 if (!isUndefined(getSortKey)) {
141 const oldSortKey = mapGet(sortKeys, rowId);
142 const newSortKey = hasRow(tableId, rowId)
143 ? getSortKey(getCell as any, rowId)
144 : undefined;
145 if (oldSortKey != newSortKey) {
146 mapSet(changedSortKeys, rowId, newSortKey);
147 }
148 }
149 };
150
151 const processTable = (force?: boolean) => {
152 onChanged(

Callers 1

setDefinitionAndListenFunction · 0.70

Calls 6

mapGetFunction · 0.90
isArrayFunction · 0.90
arrayIsEqualFunction · 0.90
mapSetFunction · 0.90
isUndefinedFunction · 0.90
hasRowFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…