Answers for "switchmap stackoverflow"

0

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
    });
Posted by: Guest on October-17-2020

Browse Popular Code Answers by Language