File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -504,5 +504,18 @@ describe('forkJoin', () => {
504
504
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
505
505
expectSubscriptions ( e2 . subscriptions ) . toBe ( e2subs ) ;
506
506
} ) ;
507
+
508
+ it ( 'should accept promise as the first arg' , done => {
509
+ const e1 = forkJoin ( Promise . resolve ( 1 ) ) ;
510
+ const values : number [ ] [ ] = [ ] ;
511
+
512
+ e1 . subscribe ( {
513
+ next : x => values . push ( x ) ,
514
+ complete : ( ) => {
515
+ expect ( values ) . to . deep . equal ( [ [ 1 ] ] ) ;
516
+ done ( ) ;
517
+ }
518
+ } ) ;
519
+ } ) ;
507
520
} ) ;
508
521
} ) ;
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ export function forkJoin(
147
147
return forkJoinInternal ( first , null ) ;
148
148
}
149
149
// TODO(benlesh): isObservable check will not be necessary when deprecated path is removed.
150
- if ( isObject ( first ) && ! isObservable ( first ) ) {
150
+ if ( isObject ( first ) && Object . getPrototypeOf ( first ) === Object . prototype ) {
151
151
const keys = Object . keys ( first ) ;
152
152
return forkJoinInternal ( keys . map ( key => first [ key ] ) , keys ) ;
153
153
}
You can’t perform that action at this time.
0 commit comments