From ad7dd69d6356cb1fb18c906ba138b5cfc9e939f9 Mon Sep 17 00:00:00 2001 From: Mateusz Podlasin Date: Fri, 10 Feb 2017 17:22:42 +0100 Subject: [PATCH] fix(forkJoin): add type signature for single observable with selector Add type signature for using forkJoin with single observable as first parameter and selector function as second parameter, so that typings would not prevent usage which is permitted and properly handled by operator. Closes #2347 --- spec/observables/forkJoin-spec.ts | 7 ++++++- src/observable/ForkJoinObservable.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/observables/forkJoin-spec.ts b/spec/observables/forkJoin-spec.ts index 06f9f2a92e..b6b5203785 100644 --- a/spec/observables/forkJoin-spec.ts +++ b/spec/observables/forkJoin-spec.ts @@ -1,7 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, expectObservable, expectSubscriptions, type}; import {lowerCaseO} from '../helpers/test-helper'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const {type}; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/src/observable/ForkJoinObservable.ts b/src/observable/ForkJoinObservable.ts index 062dc6e6d1..6fa17aef3b 100644 --- a/src/observable/ForkJoinObservable.ts +++ b/src/observable/ForkJoinObservable.ts @@ -25,6 +25,7 @@ export class ForkJoinObservable extends Observable { static create(v1: SubscribableOrPromise, v2: SubscribableOrPromise, v3: SubscribableOrPromise, v4: SubscribableOrPromise): Observable<[T, T2, T3, T4]>; static create(v1: SubscribableOrPromise, v2: SubscribableOrPromise, v3: SubscribableOrPromise, v4: SubscribableOrPromise, v5: SubscribableOrPromise): Observable<[T, T2, T3, T4, T5]>; static create(v1: SubscribableOrPromise, v2: SubscribableOrPromise, v3: SubscribableOrPromise, v4: SubscribableOrPromise, v5: SubscribableOrPromise, v6: SubscribableOrPromise): Observable<[T, T2, T3, T4, T5, T6]>; + static create(v1: SubscribableOrPromise, project: (v1: T) => R): Observable; static create(v1: SubscribableOrPromise, v2: SubscribableOrPromise, project: (v1: T, v2: T2) => R): Observable; static create(v1: SubscribableOrPromise, v2: SubscribableOrPromise, v3: SubscribableOrPromise, project: (v1: T, v2: T2, v3: T3) => R): Observable; static create(v1: SubscribableOrPromise, v2: SubscribableOrPromise, v3: SubscribableOrPromise, v4: SubscribableOrPromise, project: (v1: T, v2: T2, v3: T3, v4: T4) => R): Observable;