Calling dispatch() and/or transit() from action function
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 193
- PR merge metrics
- No merged PRs in 30d
Description
In the comment for transit function there is a note: do not send events in action_function definisions.
As I understand, that limitation is bacause of order of operations inside transit() functions:
```
current_state_ptr->exit();
action_function();
current_state_ptr = &_state_instance::value;
current_state_ptr->entry();
```
Any state change caused by action_function() will be overriden by the next line.
What if we rearrange operations so that action is last:
```
current_state_ptr->exit();
current_state_ptr = &_state_instance::value;
current_state_ptr->entry();
action_function();
```
Now we can call all API functions without limitation. Any state change caused by action_function() will count as any other.
What do you think?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.