tap() isn't triggered in RXJS Pipe
问题 I have to ways of doing the same thing, although I prefer the first one. But the first approach doesn't seem to work. (the tap() is not triggered) // does not work this.actions$.pipe( ofType(LayoutActions.Types.CHANGE_THEME), takeUntil(this.destroyed$), tap(() => { console.log('test') }), ); // works this.actions$.ofType(LayoutActions.Types.CHANGE_THEME).subscribe(() => { console.log('test') }); 回答1: Imagine RxJS pipes like actual, physical pipes with a valve at the end. Each pipe will