A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/yjs/y-indexeddb below:

yjs/y-indexeddb: IndexedDB database adapter for Yjs

IndexedDB database provider for Yjs. Documentation

Use the IndexedDB database adapter to store your shared data persistently in the browser. The next time you join the session, your changes will still be there.

You find the complete documentation published online: API documentation.

const provider = new IndexeddbPersistence(docName, ydoc)

provider.on('synced', () => {
  console.log('content from the database is loaded')
})
provider = new IndexeddbPersistence(docName: string, ydoc: Y.Doc)
Create a y-indexeddb persistence provider. Specify docName as a unique string that identifies this document. In most cases, you want to use the same identifier that is used as the room-name in the connection provider.
provider.on('synced', function(idbPersistence: IndexeddbPersistence))
The "synced" event is fired when the connection to the database has been established and all available content has been loaded. The event is also fired if no content is found for the given doc name.
provider.set(key: any, value: any): Promise<any>
Set a custom property on the provider instance. You can use this to store relevant meta-information for the persisted document. However, the content will not be synced with other peers.
provider.get(key: any): Promise>any<
Retrieve a stored value.
provider.del(key: any): Promise>undefined<
Delete a stored value.
provider.destroy(): Promise
Close the connection to the database and stop syncing the document. This method is automatically called when the Yjs document is destroyed (e.g. ydoc.destroy()).
provider.clearData(): Promise
Destroy this database and remove the stored document and all related meta-information from the database.

Yjs is licensed under the MIT License.

kevin.jahns@protonmail.com


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4