mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
## Features - https://github.com/toeverything/BlockSuite/pull/6785 @zzj3720 ## Bugfix - https://github.com/toeverything/BlockSuite/pull/6894 @Flrande - https://github.com/toeverything/BlockSuite/pull/6893 @doouding - https://github.com/toeverything/BlockSuite/pull/6891 @fundon - https://github.com/toeverything/BlockSuite/pull/6879 @doouding - https://github.com/toeverything/BlockSuite/pull/6885 @regischen - https://github.com/toeverything/BlockSuite/pull/6888 @doouding - https://github.com/toeverything/BlockSuite/pull/6890 @doouding - https://github.com/toeverything/BlockSuite/pull/6889 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6887 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6877 @EYHN - https://github.com/toeverything/BlockSuite/pull/6882 @fundon - https://github.com/toeverything/BlockSuite/pull/6886 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6884 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6881 @fundon - https://github.com/toeverything/BlockSuite/pull/6880 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6878 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6876 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6873 @pengx17 ## Refactor ## Misc - https://github.com/toeverything/BlockSuite/pull/6874 @doouding
@toeverything/y-indexeddb
Features
- persistence data in indexeddb
- sub-documents support
- fully TypeScript
Usage
import { createIndexedDBProvider, downloadBinary } from '@toeverything/y-indexeddb';
import * as Y from 'yjs';
const yDoc = new Y.Doc({
// we use `guid` as unique key
guid: 'my-doc',
});
// sync yDoc with indexedDB
const provider = createIndexedDBProvider(yDoc);
provider.connect();
await provider.whenSynced.then(() => {
console.log('synced');
provider.disconnect();
});
// dowload binary data from indexedDB for once
downloadBinary(yDoc.guid).then(blob => {
if (blob !== false) {
Y.applyUpdate(yDoc, blob);
}
});