register method

Hook register(
  1. HookEvent event,
  2. Function handler
)

Register a handler for a specific hook event.

Implementation

Hook register(HookEvent event, Function handler) {
  _handlers.putIfAbsent(event, () => <Function>{}).add(handler);
  return this;
}