If we have this machine
(machine m
(state foo)
(state bar)
(state baz)
(on event1 foo -> bar)
(on event2 foo -> baz)
(event event1 [robot heavyFunction. "do something"])
(event event2 [robot heavyFunction. "do something else"])
)
In this case, the function robot>>heavyFunction would be nice to be executed only once.
We can do that by adding a new state after foo that computes the function on a running action.
Im putting this issue to remember us to think about this use case and see what it is the best solution