@vast blade Hi, I am using your tool seldom_state.
Thank you for developing cool tool!
Is there a document or sample code how to use on_event trigger?
I want to use this trigger like .trans::<AnyEvent, _>(on_event(...?), GotEventState), but i do not now what value to pass.
I wrote like a following code:
pub fn setup(
mut commands: Commands,
mut ev_state_event: EventReader<StateEvent>,
) {
commands.spawn((
... some inserts ...
StateMachine::default()
.trans::<AnyState, _>(on_event(&mut ev_state_event), GotEventState)
);
))
This is compile error message.
error[E0277]: the trait bound `std::option::Option<StateEvent>: IntoTrigger<_>` is not satisfied
--> src/js.rs:414:39
|
414 | .trans::<AnyState, _>(on_event(ev_state_event), GotEventState)
| ----- ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoTrigger<_>` is not implemented for `std::option::Option<StateEvent>`
| |
| required by a bound introduced by this call
|