Minor Changes
-
417e5f4: Callback, event observable, listener, and subscription actors now process events they send to a parent in their own transitions.
createEffectEventStreamLogicactors do the same. Inspection reports each outgoing event on the source transition, and subscribers receive a snapshot notification for that transition. -
65afd99: Add eventless
alwaystransitions toxstate/fsm. Machines follow these transitions during initialization and after handled events until no eventless transition is enabled.import { createFSM } from 'xstate/fsm'; const machine = createFSM({ initial: 'checking', states: { checking: { always: { target: 'ready' } }, ready: {} } }); machine.initialState.value; // 'ready'
Breaking beta change:
xstate/fsmnow requires object transition targets foronandalways, matching the main XState API. Replaceon: { GO: 'ready' }withon: { GO: { target: 'ready' } }. Keepinitial: 'idle'unchanged. Transition functions must return an object orundefined.Run the
@xstate/codemodstring-targetstransform to update inline FSM configurations. Review separately stored configurations and functions returning strings manually.
Patch Changes
- 0eb9872: Fix delayed transitions and delayed raised events taking an enabled
alwaystransition before handling the delayed event. They now handle the delayed event first, then reevaluate eventless transitions, preserving v5 ordering. A delayed send also no longer reevaluates the sender's eventless transitions before delivering its event. - 9eb940c: Fix targetless transitions with
reenter: trueunexpectedly running entry behavior. Transitions without a target now preserve the active states without running exit or entry behavior, while still applying context updates and transition effects.