-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Amendment to mapTo
operator type
#5090
Comments
Sounds ok, presume this won't be breaking? |
@kwonoj If we want to not make this a breaking change, then I think we can overload the type definition of this function to the current two generic type along with the new suggested one generic type. Otherwise, this is a breaking change. Since I see @cartant referencing this suggestion in the v7 rollout, is there a point of making this a non breaking introduction when the current implementation doesn't capture the intent of the operator? |
Yeah. ATM, this is a breaking change: it will break anyone who explicitly specifies the |
I like @cartant 's suggestion to add the new signature and mark the current one as a deprecated signature. It won't be a breaking change but will push people towards the correct direction till its phased. If there are no objections, I'll put up a PR soon to address this issue. |
@cartant I have put up a PR 3 days ago. Do tell if any changes are required |
Reduce the number of generics used in the 'mapTo' function to 1 generic parameter. Mark the 2 generic variant as a deprecated variant Fixes ReactiveX#5090
Reduce the number of generics used in the 'mapTo' function to 1 generic parameter. Mark the 2 generic variant as a deprecated variant Fixes ReactiveX#5090
Bug Report
This issue is not a "bug" per se but more of an amendment suggestion to the
mapTo
operators's type. Didn't know what best to label this as.Current Behavior
mapTo
's current type signature ismapTo<T, R>(value: R): OperatorFunction<T, R>
but there is absolutely no need for theT
generic for this operator. The whole point of the operator is to start a completely new stream of values with no dependency on the source stream value.Possible Solution
I think
mapTo<R>(value: R): OperatorFunction<any, R>
may better represent the intention of using themapTo
operator.The text was updated successfully, but these errors were encountered: