diff options
Diffstat (limited to 'src/data/composite')
-rw-r--r-- | src/data/composite/wiki-properties/wikiData.js | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/data/composite/wiki-properties/wikiData.js b/src/data/composite/wiki-properties/wikiData.js index 5965b949..5cea49a0 100644 --- a/src/data/composite/wiki-properties/wikiData.js +++ b/src/data/composite/wiki-properties/wikiData.js @@ -1,20 +1,29 @@ // General purpose wiki data constructor, for properties like artistData, // trackData, etc. +import {input, templateCompositeFrom} from '#composite'; import {validateWikiData} from '#validators'; +import {inputThingClass} from '#composite/wiki-data'; + // TODO: Kludge. import Thing from '../../things/thing.js'; -// TODO: Not templateCompositeFrom. +export default templateCompositeFrom({ + annotation: `wikiData`, + + compose: false, + + inputs: { + class: inputThingClass(), + }, -export default function(thingClass) { - const referenceType = thingClass[Thing.referenceType]; + update: ({ + [input.staticValue('class')]: thingClass, + }) => { + const referenceType = thingClass[Thing.referenceType]; + return {validate: validateWikiData({referenceType})}; + }, - return { - flags: {update: true}, - update: { - validate: validateWikiData({referenceType}), - }, - }; -} + steps: () => [], +}); |