mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
docs(editor): improve documentation for store class (#10949)
This commit is contained in:
@@ -4,7 +4,7 @@ import type { InitFn } from './utils.js';
|
||||
|
||||
export const embed: InitFn = (collection: Workspace, id: string) => {
|
||||
const doc = collection.getDoc(id) ?? collection.createDoc({ id });
|
||||
doc.clear();
|
||||
doc.doc.clear();
|
||||
|
||||
doc.load(() => {
|
||||
// Add root block and surface block at root level
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { InitFn } from './utils.js';
|
||||
|
||||
export const empty: InitFn = (collection: Workspace, id: string) => {
|
||||
const doc = collection.getDoc(id) ?? collection.createDoc({ id });
|
||||
doc.clear();
|
||||
doc.doc.clear();
|
||||
|
||||
doc.load(() => {
|
||||
// Add root block and surface block at root level
|
||||
|
||||
@@ -11,9 +11,9 @@ export const linked: InitFn = (collection: Workspace, id: string) => {
|
||||
const docCId = 'doc:linked-edgeless';
|
||||
const docC = collection.createDoc({ id: docCId });
|
||||
|
||||
docA.clear();
|
||||
docB.clear();
|
||||
docC.clear();
|
||||
docA.doc.clear();
|
||||
docB.doc.clear();
|
||||
docC.doc.clear();
|
||||
|
||||
docB.load(() => {
|
||||
const rootId = docB.addBlock('affine:page', {
|
||||
|
||||
@@ -20,9 +20,9 @@ export const synced: InitFn = (collection: Workspace, id: string) => {
|
||||
const docSyncedEdgelessId = 'doc:synced-edgeless';
|
||||
const docSyncedEdgeless = collection.createDoc({ id: docSyncedEdgelessId });
|
||||
|
||||
docMain.clear();
|
||||
docSyncedPage.clear();
|
||||
docSyncedEdgeless.clear();
|
||||
docMain.doc.clear();
|
||||
docSyncedPage.doc.clear();
|
||||
docSyncedEdgeless.doc.clear();
|
||||
|
||||
docSyncedPage.load(() => {
|
||||
// Add root block and surface block at root level
|
||||
|
||||
Reference in New Issue
Block a user