At the moment fromEvent attaches its listener to pre-existing EventEmitter. And since it doesn’t start listening the observable is run, it’s quite possible for it to miss some events, which might be unwelcome in some cases.
Proposal: instead of an emitter, accept a callback that returns an emitter, and call it inside .run.
I think I’d rather create a separate lazyFromEvent than overload fromEvent and have an overhead of runtime parameter checking.
At the moment
fromEventattaches its listener to pre-existingEventEmitter. And since it doesn’t start listening the observable is run, it’s quite possible for it to miss some events, which might be unwelcome in some cases.Proposal: instead of an emitter, accept a callback that returns an emitter, and call it inside
.run.I think I’d rather create a separate
lazyFromEventthan overloadfromEventand have an overhead of runtime parameter checking.