package dev.inmo.postssystem.client.ui.fsm

import dev.inmo.micro_utils.fsm.common.dsl.FSMBuilder
import dev.inmo.micro_utils.fsm.common.dsl.buildFSM
import dev.inmo.micro_utils.fsm.common.managers.DefaultStatesManager
import dev.inmo.micro_utils.fsm.common.managers.DefaultStatesManagerRepo
import org.koin.core.qualifier.StringQualifier

val UIFSMQualifier = StringQualifier("UIFSM")

fun UIFSM(
    repo: DefaultStatesManagerRepo<UIFSMState>,
    handlersSetter: FSMBuilder<UIFSMState>.() -> Unit
) = buildFSM<UIFSMState> {
    statesManager = DefaultStatesManager(repo)
    handlersSetter()
}
