|
@@ -1,10 +1,11 @@
|
|
-import { AppDatabase } from "./data";
|
|
|
|
|
|
+import { AppDatabase, IJson } from "./data";
|
|
|
|
|
|
export class ReaderJson {
|
|
export class ReaderJson {
|
|
- static async readAll(): Promise<void> {
|
|
|
|
|
|
+ static async readAll(): Promise<Array<IJson>> {
|
|
const database = new AppDatabase();
|
|
const database = new AppDatabase();
|
|
console.time("读取数据耗时: ");
|
|
console.time("读取数据耗时: ");
|
|
- await database.jsons.toArray();
|
|
|
|
|
|
+ const data = await database.jsons.toArray();
|
|
console.timeEnd("读取数据耗时: ");
|
|
console.timeEnd("读取数据耗时: ");
|
|
|
|
+ return data;
|
|
}
|
|
}
|
|
}
|
|
}
|