Transaction
type Transaction = <TResult>(callback, options?) => TResult;
Runs a callback as one atomic transaction: every graph edit inside it
collapses into a single undo entry and a single React update (async edits
split across awaits coalesce too).
Pass rollbackOnError: true to restore the graph to its pre-transaction
state when the callback throws or rejects (the error is always re-thrown), and
deferPaint: true to defer paint on every bound paper so views repaint once,
on close. The callback may be sync or async; an async callback is awaited
before the transaction closes and the call returns the pending promise.
Type Parameters
| Type Parameter |
|---|
TResult |
Parameters
| Parameter | Type |
|---|---|
callback | () => TResult |
options? | TransactionOptions |
Returns
TResult