Files
notesnook/packages/core/api/index.js

20 lines
545 B
JavaScript
Raw Normal View History

2020-02-03 12:03:07 +05:00
import Notes from "../collections/notes";
2020-02-04 18:27:32 +05:00
import Notebooks from "../collections/notebooks";
2020-02-06 16:46:23 +05:00
import Trash from "../collections/trash";
2020-02-03 12:03:07 +05:00
class DB {
constructor(context) {
this.context = context;
}
async init() {
2020-02-04 18:27:32 +05:00
this.notebooks = new Notebooks(this.context);
2020-02-05 00:17:12 +05:00
this.notes = new Notes(this.context);
2020-02-06 16:46:23 +05:00
this.trash = new Trash(this.context);
await this.notes.init(this.notebooks, this.trash);
await this.notebooks.init(this.notes, this.trash);
await this.trash.init(this.notes, this.notebooks);
2020-02-03 12:03:07 +05:00
}
}
export default DB;