I want to ask basic question that is, what different of Diagram.commit and Model.commit.
they are same?
thank you.
Looking at the declarations in the go.d.ts
file:
Diagram:
commit(func: (d: Diagram) => void, tname?: string | null): void;
Model:
commit(func: (m: Model) => void, tname?: string | null): void;
thank you kindly, so
UndoManager.startTransaction Model.startTransaction Diagram.startTransaction
all same? just Model.startTransaction and Diagram.startTransaction is wrap of UndoManager.startTransaction?, when I can reach both diagram and model, witch one is most suitable?
Here’s the source code in the Diagram class:
public startTransaction(tname?: string): boolean {
return this.undoManager.startTransaction(tname);
}
And in the Model class:
public startTransaction(tname?: string): boolean {
return this.undoManager.startTransaction(tname);
}
So, use whatever is convenient.
Thank you!