AddHook installs the hook to be executed when certain event occurs.
(eventName Event, f func())
| 73 | |
| 74 | // AddHook installs the hook to be executed when certain event occurs. |
| 75 | func AddHook(eventName Event, f func()) { |
| 76 | hooksLck.Lock() |
| 77 | defer hooksLck.Unlock() |
| 78 | |
| 79 | hooks[eventName] = append(hooks[eventName], f) |
| 80 | } |