DocumentChangeEvent (engine/model)



Fired after each enqueueChange() block or the outermost change() block was executed and the document was changed during that block's execution.

The changes which this event will cover include:

  • document structure changes,
  • selection changes,
  • marker changes.

If you want to be notified about all these changes, then simply listen to this event like this:

model.document.on( 'change', () => {
	console.log( 'The document has changed!' );
} );

If, however, you only want to be notified about the data changes, then use change:data event, which is fired for document structure changes and marker changes (which affects the data).

model.document.on( 'change:data', () => {
	console.log( 'The data has changed!' );
} );



  • args : tuple

  • name : 'change' | 'change:data'