(changes: Changes)
| 1717 | ); |
| 1718 | |
| 1719 | const applyChanges = (changes: Changes): Store => |
| 1720 | fluentTransaction(() => |
| 1721 | ifTransformed( |
| 1722 | changes, |
| 1723 | () => |
| 1724 | ifNotUndefined( |
| 1725 | middleware[13], |
| 1726 | (willApplyChanges) => |
| 1727 | whileMutating(() => willApplyChanges(structuredClone(changes))), |
| 1728 | () => changes, |
| 1729 | ), |
| 1730 | (changes): void => { |
| 1731 | objMap(changes[0], (table, tableId) => |
| 1732 | isUndefined(table) |
| 1733 | ? delTable(tableId) |
| 1734 | : objMap(table, (row, rowId) => |
| 1735 | isUndefined(row) |
| 1736 | ? delRow(tableId, rowId) |
| 1737 | : objMap(row, (cell, cellId) => |
| 1738 | setOrDelCell( |
| 1739 | tableId, |
| 1740 | rowId, |
| 1741 | cellId, |
| 1742 | cell as CellOrUndefined, |
| 1743 | undefined, |
| 1744 | true, |
| 1745 | ), |
| 1746 | ), |
| 1747 | ), |
| 1748 | ); |
| 1749 | objMap(changes[1], (value, valueId) => |
| 1750 | setOrDelValue(valueId, value as ValueOrUndefined), |
| 1751 | ); |
| 1752 | }, |
| 1753 | contentOrChangesIsEqual, |
| 1754 | ), |
| 1755 | ); |
| 1756 | |
| 1757 | const setTablesJson = (tablesJson: Json): Store => { |
| 1758 | tryCatch(() => setOrDelTables(jsonParse(tablesJson))); |
nothing calls this directly
no test coverage detected
searching dependent graphs…