« get me outta code hell

withFlashAct.js « flash « things « composite « data « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/flash/withFlashAct.js
blob: 652b8bfb2ed7b63491276da519bb84296661021e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Gets the flash's act. This will early exit if flashActData is missing.
// If there's no flash whose list of flashes includes this flash, the output
// dependency will be null.

import {input, templateCompositeFrom} from '#composite';

import {withUniqueReferencingThing} from '#composite/wiki-data';

export default templateCompositeFrom({
  annotation: `withFlashAct`,

  outputs: ['#flashAct'],

  steps: () => [
    withUniqueReferencingThing({
      data: 'flashActData',
      list: input.value('flashes'),
    }).outputs({
      ['#uniqueReferencingThing']: '#flashAct',
    }),
  ],
});