github statelyai/xstate xstate@6.0.0-alpha.66

pre-release2 hours ago

Patch Changes

  • d175de9: Fix declaration generation for exported machine.provide({ actions }) variants and createStateConfig() fragments with invoke input mappers.

    Entry and exit functions now receive a working enq regardless of their parameter count, including default/rest parameters and forwarding wrappers. Returned context and child patches are applied consistently. Functions that enqueue no effects no longer add placeholder effects to pure transition results.

    import { createMachine } from 'xstate';
    
    const machine = createMachine({
      initial: 'loading',
      states: {
        loading: {
          entry: (...[, enq]) => enq.raise({ type: 'ready' }),
          on: { ready: { target: 'ready' } }
        },
        ready: {}
      }
    });
  • 32487c8: Fix nested and parallel state value inference for machines declaring setup({ states }) when exactOptionalPropertyTypes is enabled. Both forms of snapshot.matches(...) now accept valid nested states:

    snapshot.matches({ b: 'x' });
    snapshot.matches('b.x');

Don't miss a new xstate release

NewReleases is sending notifications on new releases.