xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
Your version
4.38.3 is the newest release of 4.x.
In short
1 new1 fixed
Release note
Minor Changes
All spawned and invoked actors now have a
.getSnapshot()method, which allows you to retrieve the latest value emitted from that actor. That value may beundefinedif no value has been emitted yet.const machine = createMachine({ context: { promiseRef: null }, initial: 'pending', states: { pending: { entry: assign({ promiseRef: () => spawn(fetch(/* ... */), 'some-promise') }) } } }); const service = interpret(machine) .onTransition(state => { // Read promise value synchronously const resolvedValue = state.context.promiseRef?.getSnapshot(); // => undefined (if promise not resolved yet) // => { ... } (resolved data) }) .start(); // ...
Patch Changes
Preserve StateMachine type when .withConfig() and .withContext() modifiers are used on a machine.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.