小编Kae*_*eko的帖子

RxJS 6 - 首先在管道中使用时是否需要取消订阅?

给出以下代码

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

javascript rxjs

8
推荐指数
1
解决办法
2366
查看次数

标签 统计

javascript ×1

rxjs ×1