Releases: nalu-development/sharpstate
4.0.0
New major release allowing you to await for asynchronous reactions in the same execution context.
Added WhenEnteredAsync and WhenExitedAsync to provide further customization in case of common reaction code upon different transitions ending up in the same state.
Also improved the performance by a lot!
👨🏼💻 Contributors
No contributors
3.2.0
Replace .Target with .TransitionTo across all state configurations to improve naming clarity.
👨🏼💻 Contributors
No contributors
3.1.0
Improved dev-experience for triggers with no parameters.
👨🏼💻 Contributors
No contributors
3.0.0
New version, improving syntax for dependency injection.
👨🏼💻 Contributors
No contributors
2.1.0
- Add overloads for
WhenEnteringandWhenExitingwith DI support - Add convenient way to configure the created service scope with Microsoft DI
👨🏼💻 Contributors
2.0.0
This release separates Context from Dependencies.
The machine context should hold state owned by the machine: counters, flags, domain values, and data that transitions mutate. Dependencies such as loggers, repositories, clients, and service facades now flow through a service-provider resolver instead of being stored on the context.
Breaking Changes
- Generated actors now require an
IStateMachineServiceProviderResolver<TServiceProvider>when created. [StateMachineDefinition]now has a service-provider type argument. It defaults toIServiceProvider.- Runtime types such as
StateMachineDefinition,StateMachineEngine,StateConfigurator,Transition, and trigger builders now includeTServiceProvider. - Guard, target,
Invoke, andReactAsyncoverloads can receiveTServiceProvider.
Migration
- If your machine does not use dependencies, pass
StateMachineEmptyServiceProviderResolver.Instance. - If you have a simple dependency facade, use
[StateMachineDefinition(typeof(MyContext), typeof(IMyServices))]and passnew StateMachineStaticServiceProviderResolver<IMyServices>(services). - If you use Microsoft DI, add
Nalu.SharpState.DependencyInjectionand useStateMachineServiceProviderResolveror theIServiceCollectionhelpers. - Keep request data needed by
ReactAsyncin the context, trigger arguments, or an immutable snapshot. Do not depend on liveHttpContextin background reactions.
New Helpers
StateMachineEmptyServiceProviderResolverStateMachineStaticServiceProviderResolver<TServiceProvider>Nalu.SharpState.DependencyInjectionpackage with Microsoft DI resolver registrations
👨🏼💻 Contributors
1.2.1
1.2.0
1.1.1
1.1.0
Improve DOT and state change
- Fix missing Stay in DOT diagram
- Add IStateAwareContext
- Improve state definition for better DOT output