github statelyai/xstate xstate@5.21.0

6 days ago

Minor Changes

  • #5364 15e15b5 Thanks @davidkpiano! - Added .createStateConfig(…) to the setup API. This makes it possible to create state configs that are strongly typed and modular.

    const lightMachineSetup = setup({
      // ...
    });
    
    const green = lightMachineSetup.createStateConfig({
      //...
    });
    
    const yellow = lightMachineSetup.createStateConfig({
      //...
    });
    
    const red = lightMachineSetup.createStateConfig({
      //...
    });
    
    const machine = lightMachineSetup.createMachine({
      initial: 'green',
      states: {
        green,
        yellow,
        red
      }
    });

Don't miss a new xstate release

NewReleases is sending notifications on new releases.