Repository navigation
xstate@4.31.0
Minor Changes
-
#3190
fbf5ca0adThanks @davidkpiano! - ThewaitFor(...)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'); // true
-
#3200
56c0a36Thanks @Andarist! - Subscribing to a stopped interpreter will now always immediately emit its state and call a completion callback.
Patch Changes
-
#3166
be4c5c74dThanks @Andarist! - Fixed an issue withstate.tagsnot having correct values when resolving micro transitions (taken in response to raised events). This was creating issues when checking tags in guards. -
#3171
14f8b4785Thanks @Andarist! - Fixed an issue withonDoneon parallel states not being "called" correctly when a parallel state had a history state defined directly on it. -
#2939
360e85462Thanks @Andarist! - Fixed issues with not disposing some cached internal values when stopping interpreters, which could have led to issues when starting such an interpreter again. -
#3153
b36ef9ddaThanks @Andarist! - Made type displays (like in the IDE tooltips etc) more readable by using a type interface for the internalResolveTypegenMetatype.