github-actions
released this
07 Feb 16:45
·
179 commits
to main
since this release
Patch Changes
-
#4731
960cdcbcb
Thanks @davidkpiano! - You can now importgetInitialSnapshot(…)
fromxstate
directly, which is useful for getting a mock of the initial snapshot when interacting with machines (or other actor logic) withoutcreateActor(…)
:import { getInitialSnapshot } from 'xstate'; import { someMachine } from './someMachine'; // Returns the initial snapshot (state) of the machine const initialSnapshot = getInitialSnapshot( someMachine, { name: 'Mateusz' } // optional input );