In most cases, you will want to inherit from the ~Plugin class which implements the
module:utils/observablemixin~Observable and is, therefore, more convenient:
classMyPluginextendsPlugin { init() { // `listenTo()` and `editor` are available thanks to `Plugin`. // By using `listenTo()` you will ensure that the listener is removed when // the plugin is destroyed. this.listenTo( this.editor.data, 'ready', () => { // Do something when the data is ready. } ); } }
In most cases, you will want to inherit from the ~Plugin class which implements the module:utils/observablemixin~Observable and is, therefore, more convenient: