registerEditorStateListener = editor => {
const unregister = editor.registerUpdateListener(event => {
event.editorState.read(() => {
const root = lexical.$getRoot();
const selection = lexical.$getSelection();
console.log(root, selection);
})
})
invalidation.then(unregister)
}