NewTaggedHook creates a new TaggedHook with the provided main hook and optional tags.
(hook *Hook[T], tags ...string)
| 19 | |
| 20 | // NewTaggedHook creates a new TaggedHook with the provided main hook and optional tags. |
| 21 | func NewTaggedHook[T Tagger](hook *Hook[T], tags ...string) *TaggedHook[T] { |
| 22 | return &TaggedHook[T]{ |
| 23 | mainHook[T]{hook}, |
| 24 | tags, |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | // TaggedHook defines a proxy hook which register handlers that are triggered only |
| 29 | // if the TaggedHook.tags are empty or includes at least one of the event data tag(s). |
no outgoing calls
searching dependent graphs…