Executes function when modifying the model

every time the model is modified, it executes a simple js function.
example:
when creating a new node, when creating a link, when changing some property of a node or link, when creating a group, when moving a node, etc.

executes function console.log(“hello world”);

Yes, but what is your question?

https://gojs.net/latest/intro/changedEvents.html