« get me outta code hell

data: refactor Thing.composite.withResolvedReference - 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-31 15:56:34 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-05 21:02:55 -0300
commit918fb043a640cf937de604fc74cb95566fa66459 (patch)
tree0c6625799981537d1093134deb6d682697109b69 /src
parentc0bbd7e8fa6c76df4fa492e3a9d3b5e9ef42ec5c (diff)
data: refactor Thing.composite.withResolvedReference
Diffstat (limited to 'src')
-rw-r--r--src/data/things/thing.js26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 501286d..389b384 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -1542,30 +1542,8 @@ export default class Thing extends CacheableObject {
       earlyExitIfNotFound = false,
     }) {
       return Thing.composite.from(`Thing.composite.withResolvedReference`, [
-        {
-          flags: {expose: true, compose: true},
-          expose: {
-            mapDependencies: {ref},
-            mapContinuation: {to},
-
-            compute: ({ref}, continuation) =>
-              (ref
-                ? continuation()
-                : continuation.raise({to: null})),
-          },
-        },
-
-        {
-          flags: {expose: true, compose: true},
-          expose: {
-            mapDependencies: {data},
-
-            compute: ({data}, continuation) =>
-              (data === null
-                ? continuation.exit(null)
-                : continuation()),
-          },
-        },
+        Thing.composite.raiseWithoutDependency(ref, {map: {to}, raise: {to: null}}),
+        Thing.composite.earlyExitWithoutDependency(data),
 
         {
           flags: {expose: true, compose: true},