Minor Changes
-
#2672
8e1d05d
Thanks @davidkpiano! - Thedescription
property is a new top-level property for state nodes and transitions, that lets you provide text descriptions:const machine = createMachine({ // ... states: { active: { // ... description: 'The task is in progress', on: { DEACTIVATE: { // ... description: 'Deactivates the task' } } } } });
Future Stately tooling will use the
description
to render automatically generated documentation, type hints, and enhancements to visual tools. -
#2743
e268bf34a
Thanks @janovekj! - Add optional type parameter to narrow type returned byEventFrom
. You can use it like this:type UpdateNameEvent = EventFrom<typeof userModel>;
Patch Changes
-
#2738
942fd90e0
Thanks @michelsciortino! - Thetags
property was missing from state's definitions. This is used when converting a state to a JSON string. Since this is how we serialize states within@xstate/inspect
this has caused inspected machines to miss thetags
information. -
#2740
707cb981f
Thanks @Andarist! - Fixed an issue with tags being missed on a service state after starting that service using a state value, like this:const service = interpret(machine).start('active'); service.state.hasTag('foo'); // this should now return a correct result
-
#2691
a72806035
Thanks @davidkpiano! - Meta data can now be specified forinvoke
configs in theinvoke.meta
property:const machine = createMachine({ // ... invoke: { src: (ctx, e) => findUser(ctx.userId), meta: { summary: 'Finds user', updatedAt: '2021-09-...', version: '4.12.2' // other descriptive meta properties } } });