Skip to content

xstate@5.12.0

Compare
Choose a tag to compare
@github-actions github-actions released this 24 Apr 19:45
· 6 commits to main since this release
a67e99f

Minor Changes

  • #4863 0696adc21 Thanks @davidkpiano! - Meta objects for state nodes and transitions can now be specified in setup({ 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