From 06bc4a5c8738a68101b4cbe726f5e5cb8d10cd2d Mon Sep 17 00:00:00 2001 From: Yazan Alaboudi Date: Mon, 21 Oct 2019 19:25:49 +0400 Subject: [PATCH] refactor(mapTo): update function signature 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/rxjs#5090 --- src/internal/operators/mapTo.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/internal/operators/mapTo.ts b/src/internal/operators/mapTo.ts index a072604d4d..2961f5d913 100644 --- a/src/internal/operators/mapTo.ts +++ b/src/internal/operators/mapTo.ts @@ -3,6 +3,10 @@ import { Subscriber } from '../Subscriber'; import { Observable } from '../Observable'; import { OperatorFunction } from '../types'; +export function mapTo(value: R): OperatorFunction; +/** @deprecated remove in v8. Use mapTo(value: R): OperatorFunction signature instead **/ +export function mapTo(value: R): OperatorFunction; + /** * Emits the given constant value on the output Observable every time the source * Observable emits a value. @@ -35,8 +39,8 @@ import { OperatorFunction } from '../types'; * @method mapTo * @owner Observable */ -export function mapTo(value: R): OperatorFunction { - return (source: Observable) => source.lift(new MapToOperator(value)); +export function mapTo(value: R): OperatorFunction { + return (source: Observable) => source.lift(new MapToOperator(value)); } class MapToOperator implements Operator {