This commit is contained in:
zadam
2023-05-05 23:41:11 +02:00
parent 6dfc72c065
commit fa3cbb4645
54 changed files with 124 additions and 128 deletions

View File

@@ -1,12 +1,13 @@
/**
* Purpose of this class is to cache list of attributes for notes.
* The purpose of this class is to cache the list of attributes for notes.
*
* Cache invalidation granularity is global - whenever a write operation is detected to notes, branches or attributes
* Cache invalidation granularity is global - whenever a write operation is detected to notes, branches or attributes,
* we invalidate the whole cache. That's OK, since the purpose for this is to speed up batch read-only operations, such
* as loading the tree which uses attributes heavily.
*/
class NoteAttributeCache {
constructor() {
/** @property {Object.<string, BAttribute[]>} */
this.attributes = {};
}
@@ -17,4 +18,4 @@ class NoteAttributeCache {
const noteAttributeCache = new NoteAttributeCache();
export default noteAttributeCache;
export default noteAttributeCache;