all access to notes and branches is now async so we can lazy load it in the future

This commit is contained in:
azivner
2018-03-25 14:49:20 -04:00
parent 297a2cd9da
commit 54e4f54678
11 changed files with 98 additions and 76 deletions

View File

@@ -25,7 +25,8 @@ class TreeCache {
}
}
getNote(noteId) {
/** @return NoteShort */
async getNote(noteId) {
return this.notes[noteId];
}
@@ -47,11 +48,13 @@ class TreeCache {
this.addBranch(branch);
}
getBranch(branchId) {
/** @return Branch */
async getBranch(branchId) {
return this.branches[branchId];
}
getBranchByChildParent(childNoteId, parentNoteId) {
/** @return Branch */
async getBranchByChildParent(childNoteId, parentNoteId) {
const key = (childNoteId + '-' + parentNoteId);
const branch = this.childParentToBranch[key];