Skip to content

Releases: statelyai/xstate

[email protected]

11 Jan 13:47
073f710
Compare
Choose a tag to compare

Patch Changes

@xstate/[email protected]

11 Jan 14:09
9c661b0
Compare
Choose a tag to compare
Pre-release

Minor Changes

Patch Changes

@xstate/[email protected]

11 Jan 14:09
9c661b0
Compare
Choose a tag to compare
Pre-release

Minor Changes

[email protected]

10 Jan 16:51
Compare
Choose a tag to compare

Minor Changes

  • #4596 6113a590a Thanks @davidkpiano! - Introduce getNextSnapshot(...), which determines the next snapshot for the given actorLogic based on the given snapshot and event.

    If the snapshot is undefined, the initial snapshot of the actorLogic is used.

    import { getNextSnapshot } from 'xstate';
    import { trafficLightMachine } from './trafficLightMachine.ts';
    
    const nextSnapshot = getNextSnapshot(
      trafficLightMachine, // actor logic
      undefined, // snapshot (or initial state if undefined)
      { type: 'TIMER' }
    ); // event object
    
    console.log(nextSnapshot.value);
    // => 'yellow'
    
    const nextSnapshot2 = getNextSnapshot(
      trafficLightMachine, // actor logic
      nextSnapshot, // snapshot
      { type: 'TIMER' }
    ); // event object
    
    console.log(nextSnapshot2.value);
    // =>'red'

Patch Changes

  • #4659 1ae07f5bf Thanks @Andarist! - Allow event in transitions to be narrowed down even when its .type is defined using a union.

[email protected]

24 Dec 04:25
94c8841
Compare
Choose a tag to compare

Patch Changes

@xstate/[email protected]

24 Dec 04:25
94c8841
Compare
Choose a tag to compare

Patch Changes

@xstate/[email protected]

24 Dec 04:25
94c8841
Compare
Choose a tag to compare

Patch Changes

@xstate/[email protected]

24 Dec 04:25
94c8841
Compare
Choose a tag to compare

Patch Changes

[email protected]

22 Dec 19:16
4dde96a
Compare
Choose a tag to compare

Minor Changes

  • #4616 e8c0b15b2 Thanks @Andarist! - context factories receive self now so you can immediately pass that as part of the input to spawned actors.

    setup({
      /* ... */
    }).createMachine({
      context: ({ spawn, self }) => {
        return {
          childRef: spawn('child', { input: { parent: self } })
        };
      }
    });

[email protected]

18 Dec 00:55
75e6187
Compare
Choose a tag to compare

Patch Changes

  • #4597 ae0b05f11 Thanks @davidkpiano! - Update the argument object of enqueueActions(...) to include the self and system properties:

    // ...
    entry: enqueueActions(({ self, system }) => {
      // ...
    });