I want to fork multiple http requests into one observable, call it by interval and share same data between all subscribers.
My code looks like this so far:
import {Observable} from "rxjs/Rx";
let obs = Observable
.interval(10000)
.publish()
.connect()
.forkJoin(
this.http.get(API_URL + "x", {headers: this.headers})
.map(response => response.json()),
this.http.get(API_URL + "y", {headers: this.headers})
.map(response => response.json())
)
.map(res => {
// do some stuff
return res;
});
Error:
Typescript Error
Property 'forkJoin' does not exist on type 'Subscription'.
I've read:
https://blog.thoughtram.io/angular/2016/06/16/cold-vs-hot-observables.html
Multiple $http requests in Ionic2
Thanks!