Delegated event sources
EventSourceinterface
An interface for managing event listeners on DOM nodes.
It abstracts the process of adding and removing event listeners, ensuring that they are properly cleaned up when the scope is closed or the element is removed.
makeEventSourcefunction
Creates a new
EventSource.The created
EventSourcecan efficiently manage multiple event listeners, grouping them by event type and handling setup/teardown lifecycles.