Hi @bradwoods , this feature was added here and is going to be released in version 3.4.
In V4 this will be:
myMachine.getStateNode('foo'); // retrieves myMachine.states.foo
myMachine.getStateNode('#someStateID'); // retrieves (nested?) state with id: someStateId
// alternatively:
myMachine.getStateNodeById('someStateId'); // same as above
myMachine.getStateNodeByPath('foo.bar.baz'); // retrieves nested state with path ['foo', 'bar', 'baz']
myMachine.getStateNodeByPath(['foo', 'bar', 'baz']); // same as above
This is to disambiguate a "State" and "StateNode", which are two different things.
This is now in master and the latest xstate@next.
Most helpful comment
In V4 this will be:
This is to disambiguate a "State" and "StateNode", which are two different things.