1. 6
    Add Actions to Transitions to Fire Side Effects
    2m 48s

Add Actions to Transitions to Fire Side Effects

InstructorKyle Shevlin

Share this video with your friends

Send Tweet

Actions are "fire-and-forget" side effects that are triggered by transitions. We set functions on a transition object's actions property to have them called when a transition is taken.

//...
EVENT_NAME: {
  target: 'name-of-state-to-transition-to',
  actions: [(context, event) => { sideEffectToFire(context, event) }]
}
//...