« get me outta code hell

data: Thing.composite.earlyExitWithoutDependency: latest syntax - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-30 15:57:22 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-05 21:02:54 -0300
commit7d6d8a2839ece38c4a70bd9e3fda73b2e0aa39b8 (patch)
tree745128e9c351395fa5de93c8414d0a56720905e9 /src
parent3336d5f15e29350656273a37c0a1c7a69d24663b (diff)
data: Thing.composite.earlyExitWithoutDependency: latest syntax
Diffstat (limited to 'src')
-rw-r--r--src/data/things/thing.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 25d8c8a3..6bdc897f 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -1325,15 +1325,21 @@ export default class Thing extends CacheableObject {
           flags: {expose: true, compose: true},
           expose: {
             dependencies: ['#availability'],
+            compute: ({'#availability': availability}, continuation) =>
+              (availability
+                ? continuation.raise()
+                : continuation()),
+          },
+        },
+
+        {
+          flags: {expose: true, compose: true},
+          expose: {
+            dependencies: ['#availability'],
             options: {value},
 
-            compute: ({
-              '#availability': availability,
-              '#options': {value},
-            }, continuation) =>
-              (availability
-                ? continuation()
-                : continuation.exit(value)),
+            compute: ({'#options': {value}}, continuation) =>
+              continuation.exit(value),
           },
         },
       ]),