« get me outta code hell

data: FlashSide (data processing & loading) - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/flash-act/withFlashSide.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-03 13:30:01 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-03 13:44:00 -0300
commit3b7adf38e6916f3be923d0ef86b60b5494f83f6b (patch)
tree3a2e594fc7f0353e12b595e833caef44781e6b9c /src/data/composite/things/flash-act/withFlashSide.js
parent22f1548f60cc0e0239299ef1374092bccedc4088 (diff)
data: FlashSide (data processing & loading)
Diffstat (limited to 'src/data/composite/things/flash-act/withFlashSide.js')
-rw-r--r--src/data/composite/things/flash-act/withFlashSide.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/data/composite/things/flash-act/withFlashSide.js b/src/data/composite/things/flash-act/withFlashSide.js
new file mode 100644
index 00000000..64daa1fb
--- /dev/null
+++ b/src/data/composite/things/flash-act/withFlashSide.js
@@ -0,0 +1,22 @@
+// Gets the flash act's side. This will early exit if flashSideData is missing.
+// If there's no side whose list of flash acts includes this act, the output
+// dependency will be null.
+
+import {input, templateCompositeFrom} from '#composite';
+
+import {withUniqueReferencingThing} from '#composite/wiki-data';
+
+export default templateCompositeFrom({
+  annotation: `withFlashSide`,
+
+  outputs: ['#flashSide'],
+
+  steps: () => [
+    withUniqueReferencingThing({
+      data: 'flashSideData',
+      list: input.value('acts'),
+    }).outputs({
+      ['#uniqueReferencingThing']: '#flashSide',
+    }),
+  ],
+});