Skip to content

Commit 84d4b42

Browse files
committed
Update README.md
1 parent 357f1f9 commit 84d4b42

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ let machine = StateMachine<MyState, MyEvent>(state: .State0) { machine in
7878
.State0 => .State1,
7979
.State1 => .State2,
8080
])
81+
82+
// add event handler
83+
machine.addHandler(event: .Event0) { context in
84+
print(".Event0 triggered!")
85+
}
8186
}
8287

8388
// initial

0 commit comments

Comments
 (0)