From eb4d99ef08e811b617ae88849f1d80827a9c74b0 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 30 Jan 2022 21:33:34 -0400 Subject: flash data --- src/thing/cacheable-object.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/thing/cacheable-object.js') diff --git a/src/thing/cacheable-object.js b/src/thing/cacheable-object.js index f478fd23..3c14101c 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`); } -- cgit 1.3.0-6-gf8a5