How can I persist the data of BlockSuite editors? #6551
-
I noticed that there is a And there is also a I am trying to play with the BlockSuite editors. My question is, how can I implement ordinary Seems that hotkeys are handled by https://block-suite.com/guide/event.html#handling-hotkeys |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can see the vanilla-indexeddb example about how you can save single BlockSuite doc via providers automatically - you can simply replace this IndexedDB provider with WebSocket provider. This provider-based approach saves Yjs binaries incrementally. More community provider example will be added recently. And you can also import or export content using the snapshot JSON format and save the JSON to your own API endpoints. This could be easier but doesn't support real-time collaboration. Regarding |
Beta Was this translation helpful? Give feedback.
You can see the vanilla-indexeddb example about how you can save single BlockSuite doc via providers automatically - you can simply replace this IndexedDB provider with WebSocket provider. This provider-based approach saves Yjs binaries incrementally. More community provider example will be added recently.
And you can also import or export content using the snapshot JSON format and save the JSON to your own API endpoints. This could be easier but doesn't support real-time collaboration.
Regarding
@blocksuite/sync
, it's designed to sync aDocCollection
with multiple documents. The documentation is not complete and we have plan to make it more reusable, but it may take longer time to evolve…