Offline Support
Adding offline support with y-indexeddb.
import { IndexeddbPersistence } from 'y-indexeddb'
const ydoc = new Y.Doc()
const roomName = 'my-room-name'
const persistence = new IndexeddbPersistence(roomName, ydoc)
// The persistence provider works similarly to the network providers:
// const network = new WebrtcProvider(roomName)npm i y-indexeddb --savepersistence.once('synced', () => { console.log('initial content loaded') })Loading HTML content without network access
Last updated