Skip to content

Commit

Permalink
[docs] Add Meta information block
Browse files Browse the repository at this point in the history
  • Loading branch information
nsk90 committed Feb 17, 2024
1 parent 2367770 commit 5ba8541
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ State management features:
* **[Guarded](https://nsk90.github.io/kstatemachine/#guarded-transitions)
and [Conditional transitions](https://nsk90.github.io/kstatemachine/#conditional-transitions)** - dynamic target
state which is calculated in a moment of event processing depending on application business logic
* **[Nested states](https://nsk90.github.io/kstatemachine/#nested-states)** - build hierarchical state machines (
statecharts)
* **[Nested states](https://nsk90.github.io/kstatemachine/#nested-states)** - build hierarchical state machines
(statecharts)
with [cross-level transitions](https://nsk90.github.io/kstatemachine/#cross-level-transitions) support
* **[Composed (nested) state machines.](https://nsk90.github.io/kstatemachine/#composed-(nested)-state-machines)** Use
state machines as atomic child states
Expand Down Expand Up @@ -71,8 +71,8 @@ State management features:
stateDiagram-v2
direction LR
[*] --> GreenState
GreenState --> YellowState : SwitchEvent
YellowState --> RedState : SwitchEvent
GreenState --> YellowState: SwitchEvent
YellowState --> RedState: SwitchEvent
RedState --> [*]
```
Expand Down
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* [Optional arguments](#optional-arguments)
* [Event argument](#event-argument)
* [Transition argument](#transition-argument)
* [Meta information](#meta-information)
* [Error handling](#error-handling)
* [Ignored events](#ignored-events)
* [Pending events](#pending-events)
Expand Down Expand Up @@ -754,6 +755,17 @@ state("first") {
> It is up to user to control that argument field is set from one listener. You can use some mutable data structure
> and fill it from multiple listeners.
## Meta information
The library provides `metaInfo` property for `IState` and `Transition` types.
`MetaInfo` is a marker interface allowing to attach some static information to library primitives.
This mechanism is extendable and users may add their own `MetaInfo` sub interfaces/classes if necessary.
Currently the only standard implementation is `UmlMetaInfo` which is useful for export feature.
See [controlling export output](#controlling-export-output).
> [!NOTE]
> MetaInfo considered to be immutable data by design
## Error handling
### Ignored events
Expand Down

0 comments on commit 5ba8541

Please sign in to comment.