Install
implementation("tech.bam:kstate-jvm:VERSION")
Snapshot releases
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // Add this line
}
// ...
implementation("tech.bam:kstate-jvm:VERSION-SNAPSHOT")
Usage
Machine
sealed class TrafficLightState {
object GREEN : TrafficLightState()
object YELLOW : TrafficLightState()
object RED : TrafficLightState()
}
val myMachine = machine<TrafficLightState> {
state(TrafficLightState.GREEN) {}
state(TrafficLightState.YELLOW) {}
state(TrafficLightState.RED) {}
}