File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -504,5 +504,18 @@ describe('forkJoin', () => {
504504 expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
505505 expectSubscriptions ( e2 . subscriptions ) . toBe ( e2subs ) ;
506506 } ) ;
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+ } ) ;
507520 } ) ;
508521} ) ;
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ export function forkJoin(
147147 return forkJoinInternal ( first , null ) ;
148148 }
149149 // 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 ) {
151151 const keys = Object . keys ( first ) ;
152152 return forkJoinInternal ( keys . map ( key => first [ key ] ) , keys ) ;
153153 }
You can’t perform that action at this time.
0 commit comments