@alwatr/fsm
Advanced tools
Comparing version 3.2.2 to 4.0.0
@@ -6,2 +6,21 @@ # Change Log | ||
## [4.0.0](https://github.com/Alwatr/flux/compare/v3.2.2...v4.0.0) (2024-11-06) | ||
### ⚠ BREAKING CHANGES | ||
* **fsm:** all name of type ActionName in class `actionRecord_` changed | ||
* **fsm:** event 'reset' fired on calling resetToInitialState and the first time in class constructor | ||
### Bug Fixes | ||
* **fsm:** run postTransition__ in resetToInitialState_ and constructor ([00ca9c1](https://github.com/Alwatr/flux/commit/00ca9c156b4a75883bad3e7d1c8907d370fd2b71)) by @AliMD | ||
### Code Refactoring | ||
* **fsm:** update action naming conventions and enhance event handling in state transitions ([c3a4094](https://github.com/Alwatr/flux/commit/c3a40940c0a5dee11dbb0fbaaa45d811603e5ff7)) by @AliMD | ||
### Dependencies update | ||
* update ([a0c4014](https://github.com/Alwatr/flux/commit/a0c40144c50ba69083864bd4403b7c0dab388a2f)) by @AliMD | ||
## [3.2.2](https://github.com/Alwatr/flux/compare/v3.2.1...v3.2.2) (2024-11-02) | ||
@@ -8,0 +27,0 @@ |
@@ -1,10 +0,10 @@ | ||
export interface StateEventDetail<S, E> { | ||
export interface StateEventDetail<S extends string, E extends string> { | ||
from: S; | ||
event: E; | ||
event: E | 'reset'; | ||
to: S; | ||
} | ||
export type StateRecord<S extends string, E extends string> = Partial<Record<S | '_all', Partial<Record<E, S>>>>; | ||
export type Action<S extends string, E extends string> = (eventDetail?: StateEventDetail<S, E>) => MaybePromise<void>; | ||
export type ActionName<S extends string, E extends string> = `on_${E}` | `on_state_exit` | `on_state_enter` | `on_${S}_exit` | `on_${S}_enter` | `on_${S}_${E}` | `on_all_${E}`; | ||
export type ActionRecord<S extends string, E extends string> = Partial<Record<ActionName<S, E>, Action<S, E>>>; | ||
export type StateRecord<S extends string, E extends string> = Partial<Record<S, Partial<Record<E | 'reset', S>>>>; | ||
export type Action<S extends string, E extends string> = (eventDetail?: StateEventDetail<S, E | 'reset'>) => MaybePromise<void>; | ||
export type ActionName<S extends string, E extends string> = `on_event_${E}` | `on_any_state_exit` | `on_any_state_enter` | `on_state_${S}_exit` | `on_state_${S}_enter` | `on_state_${S}_event_${E}`; | ||
export type ActionRecord<S extends string, E extends string> = Partial<Record<ActionName<S, E | 'reset'>, Action<S, E | 'reset'>>>; | ||
//# sourceMappingURL=type.d.ts.map |
{ | ||
"name": "@alwatr/fsm", | ||
"version": "3.2.2", | ||
"version": "4.0.0", | ||
"description": "A robust TypeScript library for implementing Flux (Finite) State Machines, enabling clear and organized management of application state and transitions.", | ||
@@ -61,4 +61,4 @@ "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)", | ||
"dependencies": { | ||
"@alwatr/nanolib": "^5.0.0", | ||
"@alwatr/observable": "^3.2.2" | ||
"@alwatr/nanolib": "^5.1.0", | ||
"@alwatr/observable": "^4.0.0" | ||
}, | ||
@@ -70,7 +70,7 @@ "devDependencies": { | ||
"@alwatr/type-helper": "^5.0.0", | ||
"@types/node": "^22.8.6", | ||
"@types/node": "^22.9.0", | ||
"jest": "^29.7.0", | ||
"typescript": "^5.6.3" | ||
}, | ||
"gitHead": "4952c4c6c9758dfcd30e9bc584aec25f10169219" | ||
"gitHead": "88875a7de14d10fd1e4c0288182dccf4f87cdc62" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87071
325
+ Added@alwatr/observable@4.0.0(transitive)
- Removed@alwatr/observable@3.2.2(transitive)
Updated@alwatr/nanolib@^5.1.0
Updated@alwatr/observable@^4.0.0