When should we use the RxJS tap operator?
问题 I do not understand from the docs. Could anyone explain it to me? 回答1: Most of the operators are working in streamed sequence, for example: source$.pipe( map((a: string) => changeAndReturnArray(a)), filter((b: string[]) => giveMeOnlySymbolsThatAreAfterNInAlphabet(b)), switchMap((c: string[]) => putToSomeObservable(c)) .... ); In that example you are not 'breaking' the stream, or jumping outside of it to do some external action. Jumping outside of stream is possible with 'tap' operator, where