Patch Changes
-
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. -
Updated dependencies [0eb9872]
-
Updated dependencies [417e5f4]
-
Updated dependencies [9eb940c]
-
Updated dependencies [65afd99]
- xstate@6.0.0-beta.3