Class SideEffect
Defined in File Reactivity.hpp
Class Documentation
-
class SideEffect
A side effect callback triggered by a change in state.
Public Functions
-
inline SideEffect(std::initializer_list<Dependency*> inputs, std::initializer_list<EffectOutput*> outputs, std::function<void(void)> callback)
Create a new piece of computed state from a source.
- Parameters:
inputs – The dependencies that should trigger a re-evaluation of the value; only these values and outputs can be accessed during execution
outputs – The state and callbacks that may be modified by this effect; only these values and inputs can be accessed during execution
callback – The function to run when the state changes
-
inline SideEffect(std::initializer_list<Dependency*> inputs, std::initializer_list<EffectOutput*> outputs, std::function<void(void)> callback)