summaryrefslogtreecommitdiff
path: root/src/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.go')
-rw-r--r--src/state.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/state.go b/src/state.go
index 10c35ef..eaf3bfa 100644
--- a/src/state.go
+++ b/src/state.go
@@ -29,7 +29,7 @@ type MachineTransition struct {
to string
}
-type HookFunction func(string, string)
+type HookFunction func(string, string, *Machine)
// This will run the statemachine (blocking).
func (m *Machine) Run() {
@@ -110,7 +110,7 @@ func (m *Machine) processEvent(event string) string {
*listener <- next
}
- m.hook(current, next) // execute registered callback function
+ m.hook(current, next, m) // execute registered callback function
m.current = next // set new state
return next
}