5.21.0
Added 1
- Added .createStateConfig(…) to the setup API to create state configs that are strongly typed and modular
Minor Changes
-
#5364
15e15b5Thanks @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 } });