From 163a5aabc963e1817020048b94d7d215ad225a77 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 2 Jun 2024 11:04:13 -0300 Subject: data: withReverseContributionList: drop 'mode' option --- .../wiki-data/withReverseContributionList.js | 28 ++-------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'src/data/composite/wiki-data') diff --git a/src/data/composite/wiki-data/withReverseContributionList.js b/src/data/composite/wiki-data/withReverseContributionList.js index 99d0c73b..b7f7a95b 100644 --- a/src/data/composite/wiki-data/withReverseContributionList.js +++ b/src/data/composite/wiki-data/withReverseContributionList.js @@ -1,9 +1,6 @@ // Analogous implementation for withReverseReferenceList, for contributions. // This is mostly duplicate code and both should be ported to the same -// underlying data form later on. Unique to contributions, the 'mode' option -// controls whether the things themselves, for which the artist is credited, -// are exposed (the default), or the actual contribution objects representing -// the relationship itself, instead. +// underlying data form later on. // // This implementation uses a global cache (via WeakMap) to attempt to speed // up subsequent similar accesses. @@ -13,7 +10,6 @@ // is used, a fresh cache will always be created. import {input, templateCompositeFrom} from '#composite'; -import {is} from '#validators'; import {exitWithoutDependency, raiseOutputWithoutDependency} from '#composite/control-flow'; @@ -32,11 +28,6 @@ export default templateCompositeFrom({ inputs: { data: inputWikiData({allowMixedTypes: false}), list: input({type: 'string'}), - - mode: input({ - validate: is('things', 'contributions'), - defaultValue: 'things', - }), }, outputs: ['#reverseContributionList'], @@ -90,25 +81,10 @@ export default templateCompositeFrom({ } return continuation({ - ['#contributions']: + ['#reverseContributionList']: cache.get(data).get(myself) ?? [], }); }, }, - - { - dependencies: ['#contributions', input('mode')], - compute: (continuation, { - ['#contributions']: contributions, - [input('mode')]: mode, - }) => continuation({ - ['#reverseContributionList']: - (mode === 'contributions' - ? contributions - : mode === 'things' - ? contributions.map(contrib => contrib.thing) - : []), - }), - }, ], }); -- cgit 1.3.0-6-gf8a5