When we want to handle error observable in RxJS v6+, we can use 'retryWhen' and 'delayWhen':

const courses$: Observable<Counse[]> = http$
.pipe(
tap(() => console.log("HTTP request")),
map(res => Object.values(res['payload'])),
shareReplay(), // avoid using async pipe multi times causing multi network request
retryWhen(errors => errors.pipe(
delayWhen(() => timer(2000)) // wait 2s after the error observable happens
))
)

[RxJS 6] The Retry RxJs Error Handling Strategy的更多相关文章

  1. [RxJS 6] The Catch and Rethrow RxJs Error Handling Strategy and the finalize Operator

    Sometime we want to set a default or fallback value when network request failed. http$ .pipe( map(re ...

  2. [RxJS] Error handling operator: catch

    Most of the common RxJS operators are about transformation, combination or filtering, but this lesso ...

  3. beam 的异常处理 Error Handling Elements in Apache Beam Pipelines

    Error Handling Elements in Apache Beam Pipelines Vallery LanceyFollow Mar 15 I have noticed a defici ...

  4. 转 InnoDB Error Handling

    14.20.4 InnoDB Error Handling Error handling in InnoDB is not always the same as specified in the SQ ...

  5. 19 Error handling and Go go语言错误处理

    Error handling and Go go语言错误处理 12 July 2011 Introduction If you have written any Go code you have pr ...

  6. Erlang error handling

    Erlang error handling Contents Preface try-catch Process link Erlang-way error handling OTP supervis ...

  7. MySQL Error Handling in Stored Procedures 2

    Summary: this tutorial shows you how to use MySQL handler to handle exceptions or errors encountered ...

  8. setjmp()、longjmp() Linux Exception Handling/Error Handling、no-local goto

    目录 . 应用场景 . Use Case Code Analysis . 和setjmp.longjmp有关的glibc and eglibc 2.5, 2.7, 2.13 - Buffer Over ...

  9. Error Handling

    Use Exceptions Rather Than Return Codes Back in the distant past there were many languages that didn ...

随机推荐

  1. webview加载本地页面

    main.xml中布局webview,activity中设置如下 MyWebView=(WebView)findViewById(R.id.webView1); MyWebView.requestFo ...

  2. android:scaleType 布局文件加载图片时候的显示方式

    android:scaleType="center" 以原图的几何中心点和ImagView的几何中心点为基准,按图片的原来size居中显示,不缩放,当图片长/宽超过View的长/宽 ...

  3. 【转】基于linux下的变量声明declare的用法

    转自:http://techcurtman.iteye.com/blog/1249512 declare 功能介绍:声明变量的属性,如果使用declare,后面没有任何参数,那么bash就会主动将所有 ...

  4. OpenAMP简介

    通常在AMP(非对称多处理)配置中,会采用在不同的处理核上运行不同的软件环境并执行各自的代码程序,各核心之间通力合作实现处理器性能的提升.在AMP系统中,所谓的主处理器通常是指最先启动且主要负责管理其 ...

  5. Android进入一个新页面,EditText失去焦点并禁止弹出键盘

    android在进入一个新页面后,edittext会自动获取焦点并弹出软键盘,这样并不符合用户操作习惯. 在其父控件下,添加如下的属性,就可以完美解决,使其进入页面后不主动获取焦点,并且不弹出软键盘: ...

  6. C#斐波那契数列方法

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  7. dos命令在vba中应用

    正常情况下想要遍历文件夹和子文件夹,可以采用递归的方式 Sub ListFilesTest() With Application.FileDialog(msoFileDialogFolderPicke ...

  8. LeetCode--寻找数组中心索引

    给定一个整数类型的数组 nums,请编写一个能够返回数组“中心索引”的方法. 我们是这样定义数组中心索引的:数组中心索引的左侧所有元素相加的和等于右侧所有元素相加的和. 如果数组不存在中心索引,那么我 ...

  9. js 根据数组分组动态生成table(相同项合并)

    <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/ ...

  10. 【vue】vue中实现标签页

    前言 tab标签页实现很多, 纯css实现, js实现等, 外加一些特殊动画. vue中实现标签页实现 keep-alive标签和is特性 vue-router中嵌套路由 is特性实现(推荐) 优点: ...