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: remove misused type parameter from static pipe #6119

Merged
merged 2 commits into from
Mar 15, 2021

Conversation

cartant
Copy link
Collaborator

@cartant cartant commented Mar 13, 2021

Description:

The static pipe utility has a signature that accepts no argument yet has a type parameter - type parameters aren't really supposed to be used like this. This PR changes the return type for that signature to be typeof identity - which is what's returned. This means that the returned function can be used without losing the type of the argument passed to it:

const func = pipe();
const value = func(42); // type of value will be 42, not unknown

Calling pipe without passing arguments is something of an edge case, but I suppose it's more likely with spread tuples or something. Anyway, it's a misused type parameter, so we should remove it.

Related issue (if exists): #5557

@cartant cartant requested a review from benlesh March 13, 2021 08:00
@benlesh benlesh merged commit 8dc7d17 into ReactiveX:master Mar 15, 2021
@cartant cartant deleted the cartant/static-pipe-identity branch March 19, 2021 07:21
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.

2 participants