()
| 237 | ): boolean => objIsEqual(tables1, tables2) && objIsEqual(values1, values2); |
| 238 | |
| 239 | export const createStore: typeof createStoreDecl = (): Store => { |
| 240 | let hasTablesSchema: boolean; |
| 241 | let hasValuesSchema: boolean; |
| 242 | let hadTables = false; |
| 243 | let hadValues = false; |
| 244 | let transactions = 0; |
| 245 | let middleware: [ |
| 246 | willSetContent?: (content: Content) => Content | undefined, |
| 247 | willSetTables?: (tables: Tables) => Tables | undefined, |
| 248 | willSetTable?: (tableId: Id, table: Table) => Table | undefined, |
| 249 | willSetRow?: (tableId: Id, rowId: Id, row: Row) => Row | undefined, |
| 250 | willSetCell?: ( |
| 251 | tableId: Id, |
| 252 | rowId: Id, |
| 253 | cellId: Id, |
| 254 | cell: Cell, |
| 255 | ) => CellOrUndefined, |
| 256 | willSetValues?: (values: Values) => Values | undefined, |
| 257 | willSetValue?: (valueId: Id, value: Value) => ValueOrUndefined, |
| 258 | willDelTables?: () => boolean, |
| 259 | willDelTable?: (tableId: Id) => boolean, |
| 260 | willDelRow?: (tableId: Id, rowId: Id) => boolean, |
| 261 | willDelCell?: (tableId: Id, rowId: Id, cellId: Id) => boolean, |
| 262 | willDelValues?: () => boolean, |
| 263 | willDelValue?: (valueId: Id) => boolean, |
| 264 | willApplyChanges?: (changes: Changes) => Changes | undefined, |
| 265 | hasWillSetRowCallbacks?: () => boolean, |
| 266 | ] = []; |
| 267 | let internalListeners: [ |
| 268 | preStartTransaction?: () => void, |
| 269 | preFinishTransaction?: () => void, |
| 270 | postFinishTransaction?: () => void, |
| 271 | cellChanged?: ( |
| 272 | tableId: Id, |
| 273 | rowId: Id, |
| 274 | cellId: Id, |
| 275 | newCell: CellOrUndefined, |
| 276 | mutating: 0 | 1, |
| 277 | defaulted: 0 | 1, |
| 278 | ) => void, |
| 279 | valueChanged?: ( |
| 280 | valueId: Id, |
| 281 | newValue: ValueOrUndefined, |
| 282 | mutating: 0 | 1, |
| 283 | defaulted: 0 | 1, |
| 284 | ) => void, |
| 285 | ] = []; |
| 286 | let mutating: 0 | 1 = 0; |
| 287 | const changedTableIds: ChangedIdsMap = mapNew(); |
| 288 | const changedTableCellIds: ChangedIdsMap2 = mapNew(); |
| 289 | const changedRowCount: IdMap<number> = mapNew(); |
| 290 | const changedRowIds: ChangedIdsMap2 = mapNew(); |
| 291 | const changedCellIds: ChangedIdsMap3 = mapNew(); |
| 292 | const changedCells: IdMap3<ChangedCell> = mapNew(); |
| 293 | const defaultedCells: IdSet3 = mapNew(); |
| 294 | const changedValueIds: ChangedIdsMap = mapNew(); |
| 295 | const changedValues: IdMap<ChangedValue> = mapNew(); |
| 296 | const defaultedValues: IdSet = setNew(); |
no test coverage detected
searching dependent graphs…