« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/cacheable-object.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/cacheable-object.js')
-rw-r--r--src/data/cacheable-object.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/data/cacheable-object.js b/src/data/cacheable-object.js
index 087f7825..a089e325 100644
--- a/src/data/cacheable-object.js
+++ b/src/data/cacheable-object.js
@@ -14,7 +14,7 @@ export default class CacheableObject {
   static cacheValid = Symbol.for('CacheableObject.cacheValid');
   static updateValue = Symbol.for('CacheableObject.updateValues');
 
-  constructor() {
+  constructor({seal = true} = {}) {
     this[CacheableObject.updateValue] = Object.create(null);
     this[CacheableObject.cachedValue] = Object.create(null);
     this[CacheableObject.cacheValid] = Object.create(null);
@@ -34,6 +34,10 @@ export default class CacheableObject {
         this[property] = null;
       }
     }
+
+    if (seal) {
+      Object.seal(this);
+    }
   }
 
   static finalizeCacheableObjectPrototype() {