Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Possibly better RxJS pipe typings? #6670

Closed
k-tten opened this issue Nov 9, 2021 · 2 comments
Closed

Possibly better RxJS pipe typings? #6670

k-tten opened this issue Nov 9, 2021 · 2 comments

Comments

@k-tten
Copy link

k-tten commented Nov 9, 2021

I know it's unlikely for someone to use 9+ operators in a pipe... but this is really bugging me...

pipe.ts' typings seems pretty huge, redundant, and unnecessary, and I want to help reduce it so:

  • It's not huge, redundant, and unnecessary
  • It can take 9+ operators and still produce the correct type

I made a simple prototype with this working in this gist (updated)

Currently, it takes in any amount of unary functions, and does the following:

  • Validates if the unary functions are composable together (parameter and return types match)
  • Spits out an unary function of the first one's parameter and the last one's return type
  • If no arguments are present it spits out the identity function
  • If only one argument is present it returns that argument

Thoughts, anyone?

Let me know if this can be possibly added.

@k-tten
Copy link
Author

k-tten commented Nov 9, 2021

Uh oh, I've been testing my prototype and it seems to not handle the obvious case when there is only one operator 😅
No matter, I think it's an easy fix though

Now fixed + works with no arguments 👍

@k-tten
Copy link
Author

k-tten commented Nov 9, 2021

Possibly related issue: #4177 ?

@ReactiveX ReactiveX locked and limited conversation to collaborators Nov 9, 2021
@kwonoj kwonoj closed this as completed Nov 9, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants