mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor(core): move workspace implementation to affine (#9504)
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
import { WorkspaceImpl } from '@affine/core/modules/workspace/impl/workspace';
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks';
|
||||
import type { Doc, DocSnapshot } from '@blocksuite/affine/store';
|
||||
import { DocCollection, Job, Schema } from '@blocksuite/affine/store';
|
||||
import { Job, Schema } from '@blocksuite/affine/store';
|
||||
|
||||
const getCollection = (() => {
|
||||
let collection: DocCollection | null = null;
|
||||
let collection: WorkspaceImpl | null = null;
|
||||
return async function () {
|
||||
if (collection) {
|
||||
return collection;
|
||||
}
|
||||
const schema = new Schema();
|
||||
schema.register(AffineSchemas);
|
||||
collection = new DocCollection({ schema });
|
||||
collection = new WorkspaceImpl({ schema });
|
||||
collection.meta.initialize();
|
||||
return collection;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user