mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-28 14:16:38 +03:00
19 lines
387 B
Markdown
19 lines
387 B
Markdown
|
# @toeverything/y-indexeddb
|
||
|
|
||
|
> This package haven't been published yet.
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
```ts
|
||
|
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();
|
||
|
});
|
||
|
```
|