add note attribute cache to speed up tree loading

This commit is contained in:
zadam
2020-05-02 18:19:41 +02:00
parent ed52f93bbb
commit 9be1d1f697
4 changed files with 61 additions and 24 deletions

View File

@@ -101,6 +101,15 @@ export default class LoadResults {
this.options.includes(name);
}
/**
* @return {boolean} true if there are changes which could affect the attributes (including inherited ones)
*/
hasAttributeRelatedChanges() {
return Object.keys(this.noteIdToSourceId).length === 0
&& this.branches.length === 0
&& this.attributes.length === 0;
}
isEmpty() {
return Object.keys(this.noteIdToSourceId).length === 0
&& this.branches.length === 0