Minor Changes
-
#3190
fbf5ca0ad
Thanks @davidkpiano! - ThewaitFor(...)
helper function, which asynchronously waits for an actor's emitted value to satisfy apredicate
before 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
56c0a36
Thanks @Andarist! - Subscribing to a stopped interpreter will now always immediately emit its state and call a completion callback.
Patch Changes
-
#3166
be4c5c74d
Thanks @Andarist! - Fixed an issue withstate.tags
not having correct values when resolving micro transitions (taken in response to raised events). This was creating issues when checking tags in guards. -
#3171
14f8b4785
Thanks @Andarist! - Fixed an issue withonDone
on parallel states not being "called" correctly when a parallel state had a history state defined directly on it. -
#2939
360e85462
Thanks @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
b36ef9dda
Thanks @Andarist! - Made type displays (like in the IDE tooltips etc) more readable by using a type interface for the internalResolveTypegenMeta
type.