Add managed `.state` property
Closed this issue · 0 comments
As a state-machine, Flow only provides access to it's current state via the .status()
method. The returned "status object" contains information about both the current state and the navigation sequence. The state-related values are static (e.g., only change when the state transitions), and the navigation values are calculated - or transposed. When idle, the navigation values are usually empty, which means half the calculations are likely unnecessary.
This issue proposes to define a new member for describing the static information about the current state. The .state
member will be a single object, mutated over the life of a Flow instance. It will contain the following properties:
- name
- path
- index
- phase
These properties will be updated as the Flow traverses it's program. The goal is to manage this property, such that it can be referenced directly; the object-member would not be dereferenced by Flow.
Third-party integration
Other packages would be able to add-to or override properties of the .state
member. By convention, package authors will be encouraged to not replace the .state
member - but instead, add and remove it's properties.