Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rxjs retryWhen not calling[angular 5]_Angular_Rxjs - Fatal编程技术网

Rxjs retryWhen not calling[angular 5]

Rxjs retryWhen not calling[angular 5],angular,rxjs,Angular,Rxjs,我在使用angular HttpClient订阅retryWhen时遇到了一个问题 我使用angular5.2.11,rxjs5.5.11 this._httpClient.get('myUrl').retryWhen((errors) => { console.log('retryWhen', errors); return errors.scan((count, error) => { if (count >= retryOptions.retries)

我在使用angular HttpClient订阅
retryWhen
时遇到了一个问题

我使用angular
5.2.11
,rxjs
5.5.11

 this._httpClient.get('myUrl').retryWhen((errors) => {
  console.log('retryWhen', errors);
  return errors.scan((count, error) => {
    if (count >= retryOptions.retries) {
      throw error;
    }
    return count + 1;
  }, 0)
    .delay(retryOptions.delay)
    .takeWhile(count => count <= retryOptions.retries);
});
this.\u httpClient.get('myUrl').retryWhen((错误)=>{
console.log('retryWhen',错误);
返回错误。扫描((计数,错误)=>{
如果(计数>=retryOptions.retries){
投掷误差;
}
返回计数+1;
}, 0)
.delay(retryOptions.delay)

.takeWhile(count=>countI事实上,那是工作对不起


我还没有看到,我的同事更新了代码,并添加了一个总是返回错误的Http拦截器。

尝试
this.\u httpClient.get('myUrl').pipe(.retryWhen((错误)=>{……)