« get me outta code hell

flash data - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/thing/cacheable-object.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-01-30 21:33:34 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-01-30 21:33:34 -0400
commiteb4d99ef08e811b617ae88849f1d80827a9c74b0 (patch)
tree571da8539fa856f3d4b55d0d1e9892a9a60ec730 /src/thing/cacheable-object.js
parentdfd84ead5bd5dfbcd7c25d08b816b28b4620ee5a (diff)
flash data
Diffstat (limited to 'src/thing/cacheable-object.js')
-rw-r--r--src/thing/cacheable-object.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/thing/cacheable-object.js b/src/thing/cacheable-object.js
index f478fd2..3c14101 100644
--- a/src/thing/cacheable-object.js
+++ b/src/thing/cacheable-object.js
@@ -214,11 +214,13 @@ export default class CacheableObject {
     #getExposeComputeFunction(property) {
         const { flags, expose } = this.#getPropertyDescriptor(property);
 
-        const compute = (!flags.update && expose?.compute);
-        const transform = (flags.update && expose?.transform);
+        const compute = expose?.compute;
+        const transform = expose?.transform;
 
         if (flags.update && !transform) {
             return null;
+        } else if (flags.update && compute) {
+            throw new Error(`Updating property ${property} has compute function, should be formatted as transform`);
         } else if (!flags.update && !compute) {
             throw new Error(`Exposed property ${property} does not update and is missing compute function`);
         }