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

fix(fromEventPattern): pass multiple arguments of event emitters to subscribe #3049

Closed

Conversation

raycarter
Copy link

Description:
The situation is like the following code:

const EventEmitter = require('events').EventEmitter;
const Observable = require('rxjs').Observable;

const emitter = new EventEmitter();

const obs = Observable.fromEventPattern(function(handler) {
  emitter.on('test', handler);
});

obs.subscribe(args => {
  console.log(args); // expected ['a', 'b', 'c']
});

emitter.emit('test', 'a', 'b', 'c');

If multiple arguments are emitted from an event, only the first will be passed to subscribe. This PR changes it to pass an array of arguments to subscribe. A test case is added to spec.ts.

Related issue (#3048)

@rxjs-bot
Copy link

rxjs-bot commented Nov 5, 2017

Messages
📖

CJS: 1377.9KB, global: 745.8KB (gzipped: 118.6KB), min: 146.1KB (gzipped: 31.6KB)

Generated by 🚫 dangerJS

@coveralls
Copy link

coveralls commented Nov 5, 2017

Coverage Status

Coverage increased (+0.002%) to 97.206% when pulling 2c0d440 on raycarter:fromEventPatternMultArgs into 8275cef on ReactiveX:master.

@kwonoj
Copy link
Member

kwonoj commented Nov 5, 2017

I'm going to close this PR for now as dupe of #2431, on discussion. I personally do not see huge need of this as selector argument allows this behavior.

@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants