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

Function addAllowCellMutator

test/unit/core/store/store-schema.test.ts:23–38  ·  view source on GitHub ↗
(
  store: Store<any>,
  tableId: Id,
  cellId: Id,
  cells: C[],
)

Source from the content-addressed store, hash-verified

21type AddMutator = (store: Store<any>) => void;
22
23const addAllowCellMutator = <C extends Cell<any, any, any>>(
24 store: Store<any>,
25 tableId: Id,
26 cellId: Id,
27 cells: C[],
28): Id =>
29 store.addRowListener(
30 tableId,
31 null,
32 (store, tableId, rowId) => {
33 if (!cells.includes(store.getCell(tableId, rowId, cellId) as C)) {
34 store.delCell(tableId, rowId, cellId);
35 }
36 },
37 true,
38 );
39
40const addAllowValueMutator = <V extends Value<any, any, any>>(
41 store: Store<any>,

Callers 1

Calls 3

addRowListenerMethod · 0.65
getCellMethod · 0.65
delCellMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…