github statelyai/xstate @xstate/effect@0.1.0-alpha.4

latest releases: @xstate/codemod@0.1.0-alpha.1, @xstate/vue@6.0.0-alpha.3, @xstate/svelte@6.0.0-alpha.3...
pre-release3 hours ago

Patch Changes

  • 8576291: Remove the @xstate.deadletter inspection event; observe undelivered events with the onRejectedEvent option. The inspection protocol is now exactly @xstate.actor and @xstate.transition. In @xstate/effect, deadLetters(actor) now streams EventRejection objects.

    createActor(machine, {
      onRejectedEvent: (rejection) => {
        console.log(rejection.event.type, rejection.reason, rejection.issues);
      }
    });

    Undelivered events are also available through system.onRejectedEvent(listener), which accepts any number of listeners added at any time and returns a subscription. The onRejectedEvent option registers a listener the same way.

    const subscription = actor.system.onRejectedEvent((rejection) => {
      console.log(rejection.event.type, rejection.reason);
    });
    subscription.unsubscribe();

Don't miss a new xstate release

NewReleases is sending notifications on new releases.