Minor Changes
f51614df
#1409 Thanks @jirutka! - Fix typeExtractStateValue
so that it generates a type actually describing aState.value
Patch Changes
-
b1684ead
#1402 Thanks @Andarist! - Improved TypeScript type-checking performance a little bit by using distributive conditional type withinTransitionsConfigArray
declarations instead of a mapped type. Kudos to @amcasey, some discussion around this can be found here -
ad3026d4
#1407 Thanks @tomenden! - Fixed an issue with not being able to run XState in Web Workers due to assuming thatwindow
orglobal
object is available in the executing environment, but none of those are actually available in the Web Workers context. -
4e949ec8
#1401 Thanks @Andarist! - Fixed an issue with spawned actors being spawned multiple times when they got spawned in an initial state of a child machine that is invoked in the initial state of a parent machine.Illustrating example for curious readers.
const child = createMachine({ initial: 'bar', context: {}, states: { bar: { entry: assign({ promise: () => { return spawn(() => Promise.resolve('answer')); } }) } } }); const parent = createMachine({ initial: 'foo', states: { foo: { invoke: { src: child, onDone: 'end' } }, end: { type: 'final' } } }); interpret(parent).start();