Skip to main content

Home > @jsplumbtoolkit/core > JsPlumbToolkit > transaction

JsPlumbToolkit.transaction() method#

Opens a transaction and runs the given function within it, then commits the transaction. If your function returns false (boolean false, not false-y), the transaction is rolled back instead of committed.

Signature:

transaction(fn: () => any, cleanupAction?: TransactionCleanupAction): void;

Parameters#

ParameterTypeDescription
fn() => anyFunction to run.
cleanupActionTransactionCleanupActionWhat to do if a transaction already exists.

Returns:

void