useEvent React Hook allows us to register a new callback function to the passed Event.
The advantage of using this Hook instead of the
on method in a React Component,
is that the registered callback function gets automatically unregistered whenever the Component unmounts.
useEvent is almost 100% typesafe.
|Event (E)||Event to which the passed callback function gets applied.||Yes|
|EventCallbackFunction<E['payload']>||Callback Function that gets applied to the passed Event||Yes|
|string | number||Key/Name of created Observer. Mainly thought for Debugging.||No|
|Agile||To which Agile Instance the Event get bound. Gets autodetect!||No|
useEvent returns nothing.