Patch Changes
-
8576291: Remove the
@xstate.deadletterinspection event; observe undelivered events with theonRejectedEventoption. The inspection protocol is now exactly@xstate.actorand@xstate.transition. In@xstate/effect,deadLetters(actor)now streamsEventRejectionobjects.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. TheonRejectedEventoption registers a listener the same way.const subscription = actor.system.onRejectedEvent((rejection) => { console.log(rejection.event.type, rejection.reason); }); subscription.unsubscribe();