Skip to content

Can you publish to the toState property of Transition class? #22

Open
@kwmt

Description

@kwmt

Because I want to determine the action according to the toState state.
If you can I can create an extension function then I can write to flow.

ex)

If toState property is publish and you define below extension

fun State.navigate() {
  when(this) {
     Solid -> foo
  }
}

we can write the following:

stateMachine.transition(<SomeEvent>).toState.navigate()

Now we can only write the following:

stateMachine.run {
    transition(it)
    state.navigate()
}

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions