From 3b7adf38e6916f3be923d0ef86b60b5494f83f6b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 3 Apr 2024 13:30:01 -0300 Subject: data: FlashSide (data processing & loading) --- src/data/composite/things/flash-act/index.js | 1 + .../composite/things/flash-act/withFlashSide.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/data/composite/things/flash-act/index.js create mode 100644 src/data/composite/things/flash-act/withFlashSide.js (limited to 'src/data/composite/things') diff --git a/src/data/composite/things/flash-act/index.js b/src/data/composite/things/flash-act/index.js new file mode 100644 index 00000000..40fecd2f --- /dev/null +++ b/src/data/composite/things/flash-act/index.js @@ -0,0 +1 @@ +export {default as withFlashSide} from './withFlashSide.js'; 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', + }), + ], +}); -- cgit 1.3.0-6-gf8a5