Effects

In statecharts, "side-effects" can be grouped into two categories:

"Fire-and-forget" effects, which execute a side-effect and do not send any events back to the statechart:

  • Actions - single, discrete effects
  • Activities - continuous effects that are disposed when the state they were started in are exited

Invoked effects, which executes a side-effect that can send and receive events:

  • Invoked Promises - single, discrete effects over time that may resolve or reject once, which are sent as events to the parent machine
  • Invoked Callbacks - continuous effects over time that may send multiple events, as well as listen for events sent directly to it, to/from the parent machine
  • Invoked Machines - continuous effects represented by Machine instances that can send/receive events, but also notify the parent machine when it has reached its final state
Last Updated: 1/22/2019, 1:35:12 PM