Hi. I’m trying to figure out how to manage multiple collaborative documents using y-codemirror.next. In this given example the main idea is built around the binding instance. We should destroy binding before switching to a new document. Unfortunately for y-codemirror.next we have no binding instance at all:
const state = EditorState.create({ doc: ytext.toString(), extensions: [ basicSetup, javascript(), yCollab(ytext, provider.awareness, { undoManager }) ] })
const view = new EditorView({ state, parent: /** @type {HTMLElement} */ (document.querySelector('#editor')) })
How can we implement this idea for y-codemirror.next?
I will be very grateful for the help.