Create an event source from an element, window, or other event target
You can manually override the expected event type using a type parameter, e.g. fromDomEvent<CustomEvent>(someTarget, "custom-event").
fromDomEvent<CustomEvent>(someTarget, "custom-event")
an HTMLElement, Window, Document, or other EventTarget.
the name of the event to add a listener for
Optional
a boolean capture option, or an object of event listener options
a source that can be subscribed or piped, issuing events from the target of the specified type.
Create an event source from an element, window, or other event target
You can manually override the expected event type using a type parameter, e.g.
fromDomEvent<CustomEvent>(someTarget, "custom-event")
.