Skip to content

Commit 2d7d0d1

Browse files
committed
Update README.md
1 parent 47d0a5b commit 2d7d0d1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ machine.state = 1
6060

6161
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)).
6262

63+
```swift
64+
enum MyEvent: StateEventType {
65+
case Event0, Event1
66+
case AnyEvent // create case=Any
67+
68+
init(nilLiteral: Void) {
69+
self = AnyEvent
70+
}
71+
}
72+
```
73+
6374
```swift
6475
let machine = StateMachine<MyState, MyEvent>(state: .State0) { machine in
6576

0 commit comments

Comments
 (0)