XState 5.30.0

5.30.0
Added 1
  • Add a filterEvents option to xstate/graph traversal helpers and createTestModel(...) to control which events should be explored from each state
Minor Changes
  • #5493 871857d Thanks @davidkpiano! - Add a filterEvents option to xstate/graph traversal helpers and createTestModel(...) to control which events should be explored from each state.

    This makes it possible to opt into enabled-only traversal for machine snapshots, such as when you only want to explore events that currently pass guards:

    import { createTestModel } from 'xstate/graph';
    
    const model = createTestModel(machine);
    
    const paths = model.getSimplePaths({
      filterEvents: (state, event) => state.can(event)
    });
    
View original

Upgraded? How did it go?

Discussion