馃挵 An activity is an action that occurs over time, and can be started and stopped
- Activities are great place for observables, which need to be subscribed and unsubscribed, or a
setInterval
which needs to be connected, or awebsocket
that needs to be connected and disconnected, etc. - In
xstate
activities are specified on theactivities
key of a machine state. - Transitioning within the same parent state will not restart its activities, but be mindful that it might start new activities.