Is anyone using any Kotlin state machine libraries...
# getting-started
c
Is anyone using any Kotlin state machine libraries? any recommendations?
f
You can use sealed classes/interfaces to make a state machine, no need of libraries
c
That’s what I’m currently doing, but I’m wondering if there’s something that will help with state transitions
For instance defining which transitions are allowed
f
You can use sealed classes and each class can implement allowed/not allowed interface
c
Implementing the FSM manually will inevitably lead to a lot of boilerplate in your sealed classes that obscure the actual intent or structure of the FSM. Tinder has a JVM-only FSM library that's pretty good https://github.com/Tinder/StateMachine
c
Thanks for responding… I saw that actually! Didn’t realize Tinder was on GitHub…. but I will check it out, thanks
m
This library provides many features and has nice DSL syntax https://github.com/nsk90/kstatemachine
313 Views