From 991386372f418b165a192a3ad36fb9b6cecc4d76 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 26 Oct 2023 19:32:14 -0300 Subject: data: Flash.color: replace erroneous syntax w/ composite definition --- src/data/things/flash.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/data/things/flash.js b/src/data/things/flash.js index 71174931..e2afcef4 100644 --- a/src/data/things/flash.js +++ b/src/data/things/flash.js @@ -9,9 +9,9 @@ import { oneOf, } from '#validators'; -import { - exposeUpdateValueOrContinue, -} from '#composite/control-flow'; +import {exposeDependency, exposeUpdateValueOrContinue} + from '#composite/control-flow'; +import {withPropertyFromObject} from '#composite/data'; import { color, @@ -26,6 +26,8 @@ import { wikiData, } from '#composite/wiki-properties'; +import {withFlashAct} from '#composite/things/flash'; + import Thing from './thing.js'; export class Flash extends Thing { @@ -67,12 +69,14 @@ export class Flash extends Thing { validate: input.value(isColor), }), - { - flags: {expose: true}, - dependencies: ['this', 'flashActData'], - compute: ({this: flash, flashActData}) => - flashActData.find((act) => act.flashes.includes(flash))?.color ?? null, - }, + withFlashAct(), + + withPropertyFromObject({ + object: '#flashAct', + property: input.value('color'), + }), + + exposeDependency({dependency: '#flashAct.color'}), ], date: simpleDate(), -- cgit 1.3.0-6-gf8a5