Yeah, thank you, it kind of resolves my issue. But for me it seems that callback inside editor.when(() => {})
doesn't really invokes after something was done about editor widget.
I tried to subscribe in different places
// I did on page load
const editor = new Editor({
view: view,
id: EDITOR_ID,
});
editor.when(() => {
console.log(1);
});
// then in on button click
view.ui.add(editor, position);
// and again
editor.when(() => {
console.log(2);
});
// and just for testing nothing doing with editor after button click
setTimeout(() => {
editorWidget.when(() => {
console.log(3);
});
}, 5000);
// Each callback happend ones, and in console I got output 1, 2, 3