Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Array of observables type

I am just curious, what will be the correct type of Observables array?

I tried:

let myObservables: Observable[] = new Array();
let myObservables: Observable<Array<any>> = new Array();
let myObservables: Observable<[]> = new Array();

but none of them are working.

I just want an array in which i can push observables so that i can pass it to Observable.forkJoin(myObservables)

like image 605
Hassan Avatar asked Oct 24 '25 05:10

Hassan


1 Answers

Okay i found it. The following are two correct ways to do it:

let myObservables: Observable<any>[] = new Array();
let myObservables: Array<Observable<any>> = new Array();

If anyone finds it helpful :)

like image 123
Hassan Avatar answered Oct 26 '25 20:10

Hassan