commit method
Starts a new transaction, calls the provided function, and commits the transaction. Code is called within a try-finally loop. If the function does not return normally, this rolls back the transaction rather than committing it. Example usage:
model.commit(m => m.addNodeData({ counter: myCounter++ }), "Added Node");
@param {Function} func the function to call as the transaction body @param {(string|null)=} tname a descriptive name for the transaction, or null to temporarily set #skipsUndoManager to true; if no string transaction name is given, an empty string is used as the transaction name @since 1.8
Implementation
void commit(
void Function(_i3.Model) func, [
_i2.String? tname,
]) {
_i4.callMethod(
this,
'commit',
[
_i4.allowInterop(func),
tname ?? _i5.undefined,
],
);
}