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

Overload take while to accept a type guard #4085

Merged
merged 3 commits into from Sep 7, 2018
Merged

Overload take while to accept a type guard #4085

merged 3 commits into from Sep 7, 2018

Conversation

chrisguttandin
Copy link
Contributor

Description:

This pull request overloads the takeWhile operator with an additional signature to accept a type guard.

I tried to keep the code as similar as possible to the corresponding overload signature of the filter operator. Please let me know, if I should change something.

I wasn't sure if the JSDoc should be changed as well. The return type of the filter operator is just Observable (without a generic) whereas the one of the takeWhile operator is Observable<T>.

Related issue (if exists):

This PR fixes #4081.

@cartant
Copy link
Collaborator

cartant commented Sep 3, 2018

Thanks. Looks good.

Could I get you to add some dtslint tests, too? For testing typings, they're much less cumbersome. And I'd like typings changes to be accompanied by dtslint tests so that we can build out coverage of the typings.

Have a look at the find tests for examples:

https://github.com/ReactiveX/rxjs/blob/master/spec-dtslint/operators/find-spec.ts

To run the tests, use this command:

npm run dtslint

@chrisguttandin
Copy link
Contributor Author

Hi, @cartant I added two dtslint tests. I never wrote a dtslint test before, so please let me know if I should change something.

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.

LTGM.

@benlesh benlesh merged commit af7b619 into ReactiveX:master Sep 7, 2018
@benlesh
Copy link
Member

benlesh commented Sep 7, 2018

Thanks, @chrisguttandin!

@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 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.

overload takeWhile with type guard
3 participants