-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-StatesApp-level states machinesApp-level states machinesC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplishedX-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Description
What problem does this solve or what need does it fill?
If you have to run the same logic when exiting multiple states, you might want to reuse the same system in multiple OnExit schedules. Unfortunately, Res<State<_>> returns the state that is being entered, not the one that was just exited, so the only way to get the previous state is to read the StateTransitionEvent.
What solution would you like?
Either have Res<State<_>> return the state being exited, or add something like PreviousState.
What alternative(s) have you considered?
As I said above, I'm currently using the StateTransitionEvent, but it's a bit clumsy.
Additional context
None that I'm aware of.
Piefayth
Metadata
Metadata
Assignees
Labels
A-StatesApp-level states machinesApp-level states machinesC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplishedX-UncontroversialThis work is generally agreed uponThis work is generally agreed upon