📅  最后修改于: 2022-03-11 14:55:26.499000             🧑  作者: Mango
#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
});