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

Function setMiddleware

src/store/index.ts:2133–2171  ·  view source on GitHub ↗
(
    willSetContent: (content: Content) => Content | undefined,
    willSetTables: (tables: Tables) => Tables | undefined,
    willSetTable: (tableId: Id, table: Table) => Table | undefined,
    willSetRow: (tableId: Id, rowId: Id, row: Row) => Row | undefined,
    willSetCell: (
      tableId: Id,
      rowId: Id,
      cellId: Id,
      cell: Cell,
    ) => CellOrUndefined,
    willSetValues: (values: Values) => Values | undefined,
    willSetValue: (valueId: Id, value: Value) => ValueOrUndefined,
    willDelTables: () => boolean,
    willDelTable: (tableId: Id) => boolean,
    willDelRow: (tableId: Id, rowId: Id) => boolean,
    willDelCell: (tableId: Id, rowId: Id, cellId: Id) => boolean,
    willDelValues: () => boolean,
    willDelValue: (valueId: Id) => boolean,
    willApplyChanges: (changes: Changes) => Changes | undefined,
    hasWillSetRowCallbacks: () => boolean,
  )

Source from the content-addressed store, hash-verified

2131 });
2132
2133 const setMiddleware = (
2134 willSetContent: (content: Content) => Content | undefined,
2135 willSetTables: (tables: Tables) => Tables | undefined,
2136 willSetTable: (tableId: Id, table: Table) => Table | undefined,
2137 willSetRow: (tableId: Id, rowId: Id, row: Row) => Row | undefined,
2138 willSetCell: (
2139 tableId: Id,
2140 rowId: Id,
2141 cellId: Id,
2142 cell: Cell,
2143 ) => CellOrUndefined,
2144 willSetValues: (values: Values) => Values | undefined,
2145 willSetValue: (valueId: Id, value: Value) => ValueOrUndefined,
2146 willDelTables: () => boolean,
2147 willDelTable: (tableId: Id) => boolean,
2148 willDelRow: (tableId: Id, rowId: Id) => boolean,
2149 willDelCell: (tableId: Id, rowId: Id, cellId: Id) => boolean,
2150 willDelValues: () => boolean,
2151 willDelValue: (valueId: Id) => boolean,
2152 willApplyChanges: (changes: Changes) => Changes | undefined,
2153 hasWillSetRowCallbacks: () => boolean,
2154 ) =>
2155 (middleware = [
2156 willSetContent,
2157 willSetTables,
2158 willSetTable,
2159 willSetRow,
2160 willSetCell,
2161 willSetValues,
2162 willSetValue,
2163 willDelTables,
2164 willDelTable,
2165 willDelRow,
2166 willDelCell,
2167 willDelValues,
2168 willDelValue,
2169 willApplyChanges,
2170 hasWillSetRowCallbacks,
2171 ]);
2172
2173 const setInternalListeners = (
2174 preStartTransaction: () => void,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…