BindFunc registers a new handler with the specified function. It is similar to [Hook.Bind] with the difference that the handler function is invoked only if the event data tags satisfy h.CanTriggerOn.
(fn func(e T) error)
| 74 | // It is similar to [Hook.Bind] with the difference that the handler |
| 75 | // function is invoked only if the event data tags satisfy h.CanTriggerOn. |
| 76 | func (h *TaggedHook[T]) BindFunc(fn func(e T) error) string { |
| 77 | return h.mainHook.BindFunc(func(e T) error { |
| 78 | if h.CanTriggerOn(e.Tags()) { |
| 79 | return fn(e) |
| 80 | } |
| 81 | |
| 82 | return e.Next() |
| 83 | }) |
| 84 | } |
nothing calls this directly
no test coverage detected