xstate@5.12.0
github-actions
released this
24 Apr 19:45
·
6 commits
to main
since this release
Minor Changes
-
#4863
0696adc21
Thanks @davidkpiano! - Meta objects for state nodes and transitions can now be specified insetup({ types: … })
:const machine = setup({ types: { meta: {} as { layout: string; } } }).createMachine({ initial: 'home', states: { home: { meta: { layout: 'full' } } } }); const actor = createActor(machine).start(); actor.getSnapshot().getMeta().home; // => { layout: 'full' } // if in "home" state