From 7548211c816af70f6c5dfe92897f82527de3986d Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 6 Dec 2023 23:28:38 -0500 Subject: final simplification of info ui fsa structure --- .../collectionFreeForm/CollectionFreeFormInfoState.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoState.tsx') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoState.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoState.tsx index 9090d0ea5..3c19ef4e9 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoState.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoState.tsx @@ -3,13 +3,10 @@ import { observer } from 'mobx-react'; import './CollectionFreeFormView.scss'; import React = require('react'); -export type infoArc = { - events: () => any; - actions: (arg?: any) => any; -}; export type infoState = { Message: string; - Arcs: infoArc[]; + Events: () => any; + Actions: (arg?: any) => any; }; export interface CollectionFreeFormInfoStateProps { @@ -18,10 +15,10 @@ export interface CollectionFreeFormInfoStateProps { @observer export class CollectionFreeFormInfoState extends React.Component { - _disposers: IReactionDisposer[] = []; + _disposer: IReactionDisposer | undefined; - clearState = () => this._disposers.map(disposer => disposer()); - initState = () => (this._disposers = this.props.state.Arcs.map(arc => reaction(arc.events, arc.actions, { fireImmediately: true }))); + clearState = () => this._disposer?.(); + initState = () => (this._disposer = reaction(this.props.state.Events, this.props.state.Actions, { fireImmediately: true })); componentDidMount(): void { this.initState(); -- cgit v1.2.3-70-g09d2