refactor: local storage

This commit is contained in:
DarkSky
2022-08-11 01:45:38 +08:00
parent 89191290e4
commit 86090be4a3
12 changed files with 318 additions and 74 deletions

View File

@@ -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,

View File

@@ -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);
}
}