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

Function applyChanges

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:1996–2029  ·  view source on GitHub ↗
(changes)

Source from the content-addressed store, hash-verified

1994 valueId
1995 );
1996 const applyChanges = (changes) => fluentTransaction(
1997 () => ifTransformed(
1998 changes,
1999 () => ifNotUndefined(
2000 middleware[13],
2001 (willApplyChanges) => whileMutating(() => willApplyChanges(structuredClone(changes))),
2002 () => changes
2003 ),
2004 (changes2) => {
2005 objMap(
2006 changes2[0],
2007 (table, tableId) => isUndefined(table) ? delTable(tableId) : objMap(
2008 table,
2009 (row, rowId) => isUndefined(row) ? delRow(tableId, rowId) : objMap(
2010 row,
2011 (cell, cellId) => setOrDelCell(
2012 tableId,
2013 rowId,
2014 cellId,
2015 cell,
2016 void 0,
2017 true
2018 )
2019 )
2020 )
2021 );
2022 objMap(
2023 changes2[1],
2024 (value, valueId) => setOrDelValue(valueId, value)
2025 );
2026 },
2027 contentOrChangesIsEqual
2028 )
2029 );
2030 const setTablesJson = (tablesJson) => {
2031 tryCatch(() => setOrDelTables(jsonParse(tablesJson)));
2032 return store;

Callers

nothing calls this directly

Calls 10

fluentTransactionFunction · 0.70
ifTransformedFunction · 0.70
whileMutatingFunction · 0.70
willApplyChangesFunction · 0.70
objMapFunction · 0.70
isUndefinedFunction · 0.70
delTableFunction · 0.70
delRowFunction · 0.70
setOrDelCellFunction · 0.70
setOrDelValueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…