You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use `<-!` operator to try transition by `Event` rather than specifying target `State` ([Test Case](https://github.com/ReactKit/SwiftState/blob/6858f8f49087c4b8b30bd980cfc81e8e74205718/SwiftStateTests/StateMachineEventTests.swift#L54-L76)).
65
+
Use `<-!` operator to try transition by `Event` rather than specifying target `State` ([Test Case](https://github.com/ReactKit/SwiftState/blob/1be67826b3cc9187dfaac85c2e70613f3129fad6/SwiftStateTests/TryEventTests.swift#L32-L54)).
State | `StateType` (protocol) | Mostly enum, describing each state e.g. `.State0`.
123
-
Event | `StateEventType` (protocol) | Name for route-group. Transition can be fired via `Event` instead of explicitly targeting next `State`.
124
-
Machine | `StateMachine` | State transition manager which can register `Route` and `Handler` separately for variety of transitions.
125
-
Transition | `StateTransition` | `From-` and `to-` states represented as `.State1 => .State2`. If `nil` is used for either state, it will be represented as `.AnyState`.
Condition | `Transition -> Bool` | Closure for validating transition. If condition returns `false`, transition will fail and associated handlers will not be invoked.
128
-
Handler | `HandlerContext -> Void` | Transition callback invoked after state has been changed.
129
-
Chain | `StateTransitionChain` | Group of continuous routes represented as `.State1 => .State2 => .State3`
State | `StateType` (protocol) | Mostly enum, describing each state e.g. `.State0`.
124
+
Event | `EventType` (protocol) | Name for route-group. Transition can be fired via `Event` instead of explicitly targeting next `State`.
125
+
State Machine | `Machine` | State transition manager which can register `Route`/`RouteMapping` and `Handler` separately for variety of transitions.
126
+
Transition | `Transition` | `From-` and `to-` states represented as `.State1 => .State2`. Also, `.Any` can be used to represent _any state_.
127
+
Route | `Route` | `Transition` + `Condition`.
128
+
Condition | `Context -> Bool` | Closure for validating transition. If condition returns `false`, transition will fail and associated handlers will not be invoked.
129
+
Route Mapping | `(event: E?, fromState: S, userInfo: Any?) -> S?` | Another way of defining routes **using closure instead of transition arrows (`=>`)**. This is useful when state & event are enum with associated values. Return value (`S?`) means "preferred-toState", where passing `nil` means no routes available. See [#36](https://github.com/ReactKit/SwiftState/pull/36) for more info.
130
+
Handler | `Context -> Void` | Transition callback invoked after state has been changed.
0 commit comments