Skip to content

Commit

Permalink
Minor corrections in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mclift authored Dec 29, 2023
1 parent a9d5a35 commit ac3490b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Entry/Exit action handlers can be supplied with a parameter of type `Transition`

### Internal transitions

Sometimes a trigger does needs to be handled, but the state shouldn't change. This is an internal transition. Use `InternalTransition` for this.
Sometimes a trigger needs to be handled, but the state shouldn't change. This is an internal transition. Use `InternalTransition` for this.

### Initial state transitions

Expand All @@ -84,7 +84,7 @@ Due to Stateless' internal structure, it does not know when it is "started". Thi

```csharp
sm.Configure(InitialState)
.OnActivate(() => sm.Fire(LetsGo)))
.OnActivate(() => sm.Fire(LetsGo))
.Permit(LetsGo, StateA)
```

Expand All @@ -110,7 +110,7 @@ It might be necessary to perform some code before storing the object state, and

### Introspection

The state machine can provide a list of the triggers that can be successfully fired within the current state via the `StateMachine.PermittedTriggers` property. Use `StateMachine.GetInfo()` to retreive information about the state configuration.
The state machine can provide a list of the triggers that can be successfully fired within the current state via the `StateMachine.PermittedTriggers` property. Use `StateMachine.GetInfo()` to retrieve information about the state configuration.

### Guard Clauses

Expand Down Expand Up @@ -182,7 +182,7 @@ This event will be invoked every time the state machine changes state.
```csharp
stateMachine.OnTransitionCompleted((transition) => { });
```
This event will be invoked at the very end of the trigger handling, after the last entry action have been executed.
This event will be invoked at the very end of the trigger handling, after the last entry action has been executed.

### Export to DOT graph

Expand All @@ -208,7 +208,7 @@ Command line example: `dot -T pdf -o phoneCall.pdf phoneCall.dot` to generate a

### Async triggers

On platforms that provide `Task<T>`, the `StateMachine` supports `async` entry/exit actions and so-on:
On platforms that provide `Task<T>`, the `StateMachine` supports `async` entry/exit actions and so on:

```csharp
stateMachine.Configure(State.Assigned)
Expand All @@ -228,7 +228,7 @@ await stateMachine.FireAsync(Trigger.Assigned);
## Advanced Features ##

### Retaining the SynchronizationContext ###
In specific situations where all handler methods must be invoked with the consumer's SynchronizationContext, set the _RetainSynchronizationContext_ property on creation:
In specific situations where all handler methods must be invoked with the consumer's `SynchronizationContext`, set the `RetainSynchronizationContext` property on creation:

```csharp
var stateMachine = new StateMachine<State, Trigger>(initialState)
Expand All @@ -237,7 +237,7 @@ var stateMachine = new StateMachine<State, Trigger>(initialState)
};
```

Setting this is vital within a Microsoft Orleans Grain for example, which requires the SynchronizationContext in order to make calls to other Grains.
Setting this is vital within a Microsoft Orleans Grain for example, which requires the `SynchronizationContext` in order to make calls to other Grains.

## Building

Expand All @@ -253,6 +253,6 @@ We welcome contributions to this project. Check [CONTRIBUTING.md](CONTRIBUTING.m

This page is an almost-complete description of Stateless, and its explicit aim is to remain minimal.

Please use the issue tracker or the if you'd like to report problems or discuss features.
Please use the issue tracker or the Discussions page if you'd like to report problems or discuss features.

(_Why the name? Stateless implements the set of rules regarding state transitions, but, at least when the delegate version of the constructor is used, doesn't maintain any internal state itself._)

0 comments on commit ac3490b

Please sign in to comment.