mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
refactor: local storage
This commit is contained in:
@@ -154,6 +154,14 @@ export abstract class ServiceBaseClass {
|
||||
await this.database.unregisterTagExporter(workspace, name);
|
||||
}
|
||||
|
||||
async setupDataExporter(
|
||||
workspace: string,
|
||||
initialData: Uint8Array,
|
||||
cb: (data: Uint8Array) => Promise<void>
|
||||
) {
|
||||
await this.database.setupDataExporter(workspace, initialData, cb);
|
||||
}
|
||||
|
||||
protected async _observe(
|
||||
workspace: string,
|
||||
blockId: string,
|
||||
|
||||
@@ -192,4 +192,13 @@ export class Database {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async setupDataExporter(
|
||||
workspace: string,
|
||||
initialData: Uint8Array,
|
||||
callback: (binary: Uint8Array) => Promise<void>
|
||||
) {
|
||||
const db = await this.getDatabase(workspace);
|
||||
await db.setupDataExporter(initialData, callback);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user