Tinder / StateMachine

A Kotlin and Swift DSL for finite state machine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to start the machine in a specific state?

SemionPar opened this issue · comments

I have a use case where the state machine is governing a long running process that spans over multiple device restarts (android). Is there a way I can start the machine in a specific state (different from default initial state)?

Related to #7

+1: Would have been really useful to have this capability.

Instead of using gradle, just download the code, and introduce the following method in StateMachine class:
fun setState(state: STATE) {
stateRef.set(state)
}

Instead of using gradle, just download the code, and introduce [a state setter]

Maybe altering the constructor would be more appropriate?