给出以下代码
function triggerAction() {
const asyncAction$ = of("value1");
asyncAction$
.clientLogin()
.pipe(
first(),
tap(val => console.log(`Test: ${val}`)),
)
.subscribe();
}
Run Code Online (Sandbox Code Playgroud)
我需要取消订阅吗?以前,当首先使用已修补的运算符时,它们会在第一个事件发出后取消订阅,但是文档中没有立即清楚管道运算符等效运算符是否相同.
https://www.learnrxjs.io/operators/filtering/first.html https://rxjs-dev.firebaseapp.com/api/operators/first