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: fromEvent() type with resultSelector #6447

Merged
merged 4 commits into from Jun 21, 2021
Merged

fix: fromEvent() type with resultSelector #6447

merged 4 commits into from Jun 21, 2021

Conversation

rocwang
Copy link
Contributor

@rocwang rocwang commented Jun 3, 2021

Description:

This PR simply fixes the return type of one overloaded form of fromEvent() that accepts a resultSelector.

With a resultSelector: (event: T) => R, fromEvent<T, R> should return a Observable<R>, instead of Observable<T>.

Related issue (if exists): N/A

@cartant
Copy link
Collaborator

cartant commented Jun 3, 2021

This change affects the public API, so the api_guardian files will need to be updated by running npm run api_guardian:update.

@rocwang
Copy link
Contributor Author

rocwang commented Jun 3, 2021

This change affects the public API, so the api_guardian files will need to be updated by running npm run api_guardian:update.

@cartant Thanks for the reminder! The api_guardian files are updated now.

@cartant
Copy link
Collaborator

cartant commented Jun 4, 2021

I've had a closer look at the dtslint tests to see why this wasn't picked up. We should add two tests similar to these and should include the options argument so that those signatures are tested:

https://github.com/ReactiveX/rxjs/blob/7.1.0/spec-dtslint/observables/fromEvent-spec.ts#L23-L30

FYI, the dtslint tests are run using npm run dtslint.

@rocwang
Copy link
Contributor Author

rocwang commented Jun 4, 2021

Good call. I've added 4 more dtslint tests there for fromEvent. Now all overload forms should be covered.

Copy link
Collaborator

@cartant cartant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@rocwang
Copy link
Contributor Author

rocwang commented Jun 4, 2021

Just fixed a typo.

@benlesh benlesh merged commit 39b9d81 into ReactiveX:master Jun 21, 2021
@rocwang rocwang deleted the bug/fix-from-event-type branch June 22, 2021 10:56
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

Successfully merging this pull request may close these issues.

None yet

3 participants