xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
4.38.3 is the newest release of 4.x.
In short
2 new4 fixed
Release note
Minor Changes
The
waitFor(...)helper function, which asynchronously waits for an actor's emitted value to satisfy apredicatebefore atimeout, is now available.Example usage:
import { waitFor } from 'xstate/lib/waitFor'; // ... const loginService = interpret(loginMachine).start(); const loggedInState = await waitFor(loginService, state => state.hasTag('loggedIn') ); loggedInState.hasTag('loggedIn'); // trueSubscribing to a stopped interpreter will now always immediately emit its state and call a completion callback.
Patch Changes
Fixed an issue with
state.tagsnot having correct values when resolving micro transitions (taken in response to raised events). This was creating issues when checking tags in guards.Fixed an issue with
onDoneon parallel states not being "called" correctly when a parallel state had a history state defined directly on it.Fixed issues with not disposing some cached internal values when stopping interpreters, which could have led to issues when starting such an interpreter again.
Made type displays (like in the IDE tooltips etc) more readable by using a type interface for the internal
ResolveTypegenMetatype.
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.