I want to update my rxjs code to 6 got I don't get it.
Before I had the below that wouth poll for new data every 5 seconds:
import { Observable, interval } from 'rxjs';
import { switchMap, map } from 'rxjs/operators';
var result = interval(5000).switchMap(() => this._authHttp.get(url)).map(res => res.json().results);
Now...of course, it's broken and the documentation leaves me nowhere to go.
How do I write the above to conform to rxjs 6?
Thanks
The code should be something like the following. You need to use the pipe
operator.
import { interval } from 'rxjs';
import { switchMap, map } from 'rxjs/operators';
const result = interval(5000).pipe(
switchMap(() => this._authHttp.get(url)),
map(res => res.results)
)