Create an event source from an arbitrary subscribe/unsubscribe function
The supplied "subscribe" function will be passed a 1-argument callback and
must return an unsubscribe function. The callback should be called with
events of the appropriate type, and the unsubscribe function will be called
when the connection is closed.
(Note: it's okay if the act of subscribing causes an immediate callback, as
the subscribe function will be called in a separate microtask.)
Create an event source from an arbitrary subscribe/unsubscribe function
The supplied "subscribe" function will be passed a 1-argument callback and must return an unsubscribe function. The callback should be called with events of the appropriate type, and the unsubscribe function will be called when the connection is closed.
(Note: it's okay if the act of subscribing causes an immediate callback, as the subscribe function will be called in a separate microtask.)