Below is a code sample that gives me results every 30 seconds, however, when a component subscribes to the service, it also has to wait 30 seconds for the initial set of data:
getTasks(query: string): Observable<any> {
return this._http.get(this._ripcord + '/tasks' + query, this.getHttpOptions())
.map((response: Response) => <any>response.json())
.delay(30000)
.repeat()
.do(data => console.log(data))
.catch(this.handleError);
}
I looked at a similar issue on stack but this solution doesn't work for me.
Does anyone know what operator I can use, in combination, to retrieve the initial data immediately on subscribe?