Example #1
0
        public Action AddStateChangeListener <SSS>(Func <SubState, SSS> getSubSubState, Action <SSS> onChanged)
        {
            Action newListener = ImmutableExtensions.NewSubstateChangeListener(() => getSubSubState(latestSubState), onChanged);

            innerListeners += newListener;
            return(newListener);
        }
        public Action AddStateChangeListener <T>(Func <SubState, T> getSubSubState, Action <T> onChanged, bool triggerInstantToInit = true)
        {
            Action newListener = ImmutableExtensions.NewSubstateChangeListener(() => getSubSubState(latestSubState), onChanged);

            innerListeners += newListener;
            if (triggerInstantToInit)
            {
                onChanged(getSubSubState(latestSubState));
            }
            return(newListener);
        }