This differs from regular client-territories in that it:
contains information about what actual core-api call was made (e.g. setAttribute, copyNode, moveNode etc.)
only dispatches events made from the current client (and not other connected users - these events would be handled on their side)
Note that the event-handler will only be invoked after the commit has been persisted in the database. (The event-data contains the commitStatus to check the status of the commit.)
Example of how to use:
function eventHandler(client_, data) {
// meta-data
console.log(data.projectId); // e.g. 'guest+MyProject'
console.log(data.branchName); // e.g. 'master'
console.log(data.prevRootHash); // root-hash where the changes were applied
console.log(data.prevCommitHash); // commit-hash where the changes were applied
console.log(JSON.stringify(data.commitObject)); // contains time-stamp, userId, and hashes for new state
console.log(data.commitStatus); // e.g. 'SYNCED', see client.CONSTANTS.STORAGE
// callSequence is an array of objects - each one describing an invocation within a currently open transaction
const call1 = data.callSequence[0];
console.log(call1.name); // e.g. 'setAttribute'
console.log(call1.args); // e.g. ['/node/path', 'name', 'ANewName', 'commit Message']
console.log(call1.return); // e.g. undefined
}
client.addEventListener(client.CONSTANTS.CORE_CALL_SEQUENCE, eventHandler);
This differs from regular client-territories in that it:
setAttribute
,copyNode
,moveNode
etc.)Note that the event-handler will only be invoked after the commit has been persisted in the database. (The event-data contains the
commitStatus
to check the status of the commit.)Example of how to use:
Cleaning up handlers...