Skip to content

Transaction@sheetwrite/core

On this page

Low-level Store transaction. epoch provides optional optimistic concurrency at the storage boundary.

Calling Store.applyTransaction bypasses Grid read-only checks and Grid undo/redo history. Host-driven edits should use Grid.applyTransaction.

Examples

import type { Store, SheetId, Transaction } from "@sheetwrite/core";
function setAmount(store: Store, sheet: SheetId) {
patches: [{ op: "set", addr: { sheet, row: 0, col: 0 }, value: { kind: "literal", value: 25 } }],
};
}

See also

Members 2

patches Ordered document operations submitted as one store commit.
patches: DocumentOp[];
epoch Expected current store epoch; a mismatch returns a conflict without applying patches.
epoch?: number;

Declaration

View full TypeScript declaration
export interface Transaction {
patches: DocumentOp[];
epoch?: number;
}

Referenced by

Workspace packages depending on @sheetwrite/core

  • @sheetwrite/benchdependency
  • @sheetwrite/docs-startdependency
  • @sheetwrite/reactdependency
  • @sheetwrite/sveltedependency
  • @sheetwrite/vuedependency
  • @sheetwrite/xlsxdependency

Public exports naming Transaction

Documentation