github statelyai/xstate xstate@5.0.0-beta.52

pre-release5 months ago

Major Changes

  • #4531 a5b198340 Thanks @Andarist! - The order of type parameters in ActorRef has been changed from from ActorRef<TEvent, TSnapshot> to ActorRef<TSnapshot, TEvent> for consistency with other types.

  • #4529 43843ea26 Thanks @Andarist! - The pure() and choose() action creators have been removed, in favor of the more flexible enqueueActions() action creator:

    entry: [
      // pure(() => {
      //   return [
      //     'action1',
      //     'action2'
      //   ]
      // }),
      enqueueActions(({ enqueue }) => {
        enqueue('action1');
        enqueue('action2');
      })
    ];
    entry: [
      // choose([
      //   {
      //     guard: 'someGuard',
      //     actions: ['action1', 'action2']
      //   }
      // ]),
      enqueueActions(({ enqueue, check }) => {
        if (check('someGuard')) {
          enqueue('action1');
          enqueue('action2');
        }
      })
    ];

Minor Changes

  • #4521 355e89627 Thanks @davidkpiano! - The event type of internal after events changed from xstate.after(1000)#some.state.id to xstate.after.1000.some.state.id for consistency.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.