You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letdoc=newY.Doc()console.log('init main doc');doc.on('subdocs',({ loaded })=>{loaded.forEach(subdoc=>{console.log('init subdoc provider');newSomethingProvider(subdoc.guid,subdoc)})})letsubDoc=doc.getMap("map").get("some_sub_doc")subDoc.on('synced',()=>{console.log('synced');// when doc synced by provider, we can get sub doc's data})console.log('loading');subDoc.load()// exec workflow:// init main doc -> loading -> init subdoc provider -> synced
In y-octo, we have implemented the parsing of sub doc identifiers in ydoc, this means that to add subdoc support to y-octo, what we need to do is:
provide an API to allow doc to know its own synchronization status
provide an API, pass in a doc instance, and use external implementation to load the doc binary from anywhere and apply update
maintain a thread-safe weak reference to a subdoc instance inside doc
The text was updated successfully, but these errors were encountered:
In yjs, sub doc is loaded in the following way:
In
y-octo
, we have implemented the parsing of sub doc identifiers in ydoc, this means that to add subdoc support toy-octo
, what we need to do is:The text was updated successfully, but these errors were encountered: