statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
26.51k stars 1.22k forks source link

`actor.getSnapshot().value` does not contain `compound` state types #4925

Open justinr1234 opened 1 month ago

justinr1234 commented 1 month ago

Bug or feature request?

Bug

Description:

actor.getSnapshot().value does not include states with type compound.

(Bug) Expected result:

actor.getSnapshot().value should be a union of all non-compound state value strings as well as objects containing compound states.

This should be the same as actor.getSnapshot().matches which accepts parameters that are the correct union of possible state types that originated from setup().createMachine().

(Bug) Actual result:

actor.getSnapshot().value only contains a union of non-compound state strings.

(Bug) Potential fix:

Make the type of actor.getSnapshot().value match the type of the input parameter to actor.getSnapshot().matches().