Minor Changes
- #3234
ce376b388
Thanks @Andarist! - Added aStateValueFrom
helper that can be used to extract valid state values from a machine. This might specifically be useful with typegen because typegenlessstate.matches
acceptsany
anyway.
Patch Changes
-
#3215
44c66e74f
Thanks @tom-sherman! - Removing the timeout that's built in towaitFor
is now supported by explicitly passing anInfinity
value.Example usage:
import { waitFor } from 'xstate/lib/waitFor'; // This will const loggedInState = await waitFor( loginService, state => state.hasTag('loggedIn'), { timeout: Infinity } );
This fixes a bug that causes
waitFor
to reject with an error immediately due to the behaviour ofsetTimeout
. -
#3230
780458c92
Thanks @Andarist! - Fixed an issue with typegen types not being able to provide events that had a union of strings as theirtype
(such as{ type: 'INC' | 'DEC'; value: number; }
). -
#3252
a94dfd467
Thanks @Andarist! - Fixed an issue withEventFrom
not being able to extract events that had a union of strings as theirtype
(such as{ type: 'INC' | 'DEC'; value: number; }
). -
#3090
c4f73ca13
Thanks @Andarist! - Fixed an issue with action objects not receiving correct event types when used in the second argument to thecreateMachine
. -
#3238
3df6335ef
Thanks @davidkpiano! - The typings forsendTo(...)
have been fixed. -
#3228
fe5f0e6c9
Thanks @Andarist! - Fixed an issue with inline functions in the config object used as transition actions not having their argument types inferred. -
#3252
a94dfd467
Thanks @Andarist! - Fixed an issue with defaultTEvent
({ type: string }
) not being correctly provided to inline transition actions.