diff options
Diffstat (limited to 'src/thing/cacheable-object.js')
-rw-r--r-- | src/thing/cacheable-object.js | 6 |
1 files changed, 4 insertions, 2 deletions
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`); } |