[Question] Transition in `onFinished`?
See original GitHub issueIs it possible to create a transition in onFinished
?
My main goal is to define a sets of nested states in different gradle modules and then combine them into a “big” state machine in another gradle module which also defines a transitions between those nested children when they finish.
// this function is defined in an independent gradle module,
// it has no knowldege of "parent", containing states, so it can't mention them
// in `transition` block of `done` state
fun IState.addStates() {
lateinit var done: State
initialState("a") {
transition<Event> {
targetState = done
}
}
done = finalState("done")
}
// this function is defined in main(root) gradle module, which
// depends on the above module
fun main() {
val machine = createStateMachine {
lateinit var s2: State
initialState("s1") {
addStates()
onFinished {
// this is currently not possible, onFinished is a simple listener
targetState = s2
}
}
s2 = state("s2") {
// ...
}
}
}
IIRC, something like this is possible in scxml
and xstate.js
.
Is this possible in kstatemachine
? Am I missing some other idiom which can be used to achieve this.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to use $transitions? - Stack Overflow
In new versions (>=1.0.0) the $state change events are deprecated, and now you have to use the $transitions instead... $transitions for new ...
Read more >How to assign and transition conditionally? · Issue #850 - GitHub
Question /Feature Request Description: I am in the process of building a multi step form. When a field is filled, I am firing...
Read more >chrome.webNavigation - Chrome Developers
The webNavigation API's onCommitted event has a transitionType and a transitionQualifiers property. The transition type is the same as used in the history...
Read more >Creating Transitions and Timeline Animation in JavaFX
Learn how to create animation in JavaFX, including timelines, transitions, key frames, and rotation.
Read more >Problem with killing and reinitialising ScrollTrigger after Single ...
I'm pretty sure the problem is related to the BarbaJS-like page transition the wordpress theme has implemented and that it doesn't calculate the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Transitions on FinishedEvent will be released in v0.16.0
Oh! No, you are right. I have added this to
catch_fish.success
:And when in
success
state I can send thisSTUFF
event, even thoughsuccess
is a final state!