fromEvent
fromEvent is a function in RxJS that creates an observable from events emitted by a given event target. It attaches a listener for a specified event type on the target (typically via addEventListener) and emits each event object to subscribers. The listener is removed automatically when the subscription is disposed, helping to prevent memory leaks.
Usage and behavior: fromEvent(target, eventName) returns an observable that emits events of the requested type. For
Notes: fromEvent is commonly used for integrating imperative DOM events into reactive streams, enabling composition with