diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-10-26 19:32:14 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-10-26 19:37:14 -0300 |
commit | 991386372f418b165a192a3ad36fb9b6cecc4d76 (patch) | |
tree | cd08f3b21f8da029a44937fd8e75ea570dcfd45a /src | |
parent | 855dcdbc17831809cfb3c800d378c62186702740 (diff) |
data: Flash.color: replace erroneous syntax w/ composite definition
Diffstat (limited to 'src')
-rw-r--r-- | src/data/things/flash.js | 22 |
1 files 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(), |