AFFiNE/packages/y-indexeddb/README.md
2023-04-11 23:37:24 -05:00

387 B

@toeverything/y-indexeddb

This package haven't been published yet.

Usage

import { createIndexedDBProvider } from '@toeverything/y-indexeddb';
import * as Y from 'yjs';
const yDoc = new Y.Doc();

const provider = createIndexedDBProvider('docName', yDoc);
provider.connect();
await provider.whenSynced.then(() => {
  console.log('synced');
  provider.disconnect();
});