github statelyai/xstate xstate@5.0.0-beta.26

latest releases: @xstate/svelte@3.0.5, @xstate/vue@3.1.4, @xstate/store@2.6.0...
pre-release12 months ago

Minor Changes

  • #4220 c67a3d3b0 Thanks @davidkpiano! - Partial event descriptors are now type-safe:

    createMachine({
      types: {} as {
        events:
          | { type: 'mouse.click.up'; direction: 'up' }
          | { type: 'mouse.click.down'; direction: 'down' }
          | { type: 'mouse.move' }
          | { type: 'keypress' };
      },
      on: {
        'mouse.click.*': {
          actions: ({ event }) => {
            event.type;
            // 'mouse.click.up' | 'mouse.click.down'
            event.direction;
            // 'up' | 'down'
          }
        },
        'mouse.*': {
          actions: ({ event }) => {
            event.type;
            // 'mouse.click.up' | 'mouse.click.down' | 'mouse.move'
          }
        }
      }
    });

Don't miss a new xstate release

NewReleases is sending notifications on new releases.