Store the handler function and associated abort controller instance if available to be used when events are triggered.
The eventHandler wrapped function to be called for the event.
Assign an AbortSignal provided or create one (if true), otherwise null.
Store the handler function and associated abort controller instance if available to be used when events are triggered.