Yes I read about this
I tried this
if (event.isTransactionFinished) {
console.log(“transaction finish”);
let txn = event.object;
if (txn != null) {
time to save …
}
}
but if I do also something like this in my app
this.diagram.commit(() => {
this.diagram.isEnabled = true / false;
});
then I also get the information that transaction was ended
I thought that the isEnabled causing a transaction of with points property change,
but it turned out that this is related to the links,
it happened that when i just started the model i got points change I am not sure why i get this
anyway I can filter the known properties like isEnabled and points,
the only problem I have , is why I get points change when I just load the model
so my code look like this
if (event.isTransactionFinished) {
let txn = event.object;
if (txn != null) {
let firstChange = txn.changes
.filter((evt) => {
return evt.propertyName != "points" &&
evt.propertyName != "enabled"
}).first();
if (firstChange) {
time to save
}
}
}
If you only want to do something if there have been changes to the model, you could see if there are any ChangedEvents that have ChangedEvent.model equal to the model that you care about.