Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Lazy emitter initialization #4

Open
hoichi opened this issue Feb 27, 2018 · 0 comments
Open

Feature: Lazy emitter initialization #4

hoichi opened this issue Feb 27, 2018 · 0 comments

Comments

@hoichi
Copy link
Collaborator

hoichi commented Feb 27, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant