RunHooks runs the hooks installed for the specified eventName in the reverse order.
(eventName Event)
| 65 | // RunHooks runs the hooks installed for the specified eventName in the reverse |
| 66 | // order. |
| 67 | func RunHooks(eventName Event) { |
| 68 | hooks := hooksToRun(eventName) |
| 69 | for i := len(hooks) - 1; i >= 0; i-- { |
| 70 | hooks[i]() |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // AddHook installs the hook to be executed when certain event occurs. |
| 75 | func AddHook(eventName Event, f func()) { |
no test coverage detected