ninomi
0
Q:

switchmap stackoverflow

#switchMap cancels the previous inner observable when the outer observable emits.
#For example
Observable.fromEvent(inputEl, 'keydown') // outer observable
    .switchMap(event => {
        let value = event.value;

        return this.myXYZService.search(value); // inner observable
    })
    .subscribe(res => {
        // some code
    });
0

New to Communities?

Join the community