Minor Changes
-
#4979
a0e9ebcef
Thanks @davidkpiano! - State IDs are now strongly typed as keys ofsnapshot.getMeta()
for state machine actor snapshots.const machine = setup({ // ... }).createMachine({ id: 'root', initial: 'parentState', states: { parentState: { meta: {}, initial: 'childState', states: { childState: { meta: {} }, stateWithId: { id: 'state with id', meta: {} } } } } }); const actor = createActor(machine); const metaValues = actor.getSnapshot().getMeta(); // Auto-completed keys: metaValues.root; metaValues['root.parentState']; metaValues['root.parentState.childState']; metaValues['state with id']; // @ts-expect-error metaValues['root.parentState.stateWithId']; // @ts-expect-error metaValues['unknown state'];
Patch Changes
- #5002
9877d548b
Thanks @davidkpiano! - Fix an issue whereclearTimeout(undefined)
was sometimes being called, which can cause errors for some clock implementations. See #5001 for details.