RXJS v6.4 switchMap运算符返回一个Observable而不是结果(根据TypeScript linter)

时间:2019-06-13 14:04:04

标签: typescript rxjs6 angular8 switchmap

我正在运行Angular 8应用程序,但出现错误,这似乎是RxJS中的主要错误,或者我丢失了一些东西。

//2, 3, 4

现在,我希望订户将收到以下输出:

//Observable<number>, Observable<number>, Observable<number>

但是,它输出的是我在switchMap操作中返回的实际可观察​​值:

Observable<Observable<number>>

摘要

本质上,似乎switchMap返回的类型为Observable<number>而不是flatMap类型的值。

我不确定这是否是TypeScript或RxJS错误,但是当我将RxJS还原到6.0.0版时,问题似乎消失了。


版本:

  • 角度8.0.0
  • TypeScript 3.4.5
  • RxJS 6.4.0

我刚刚测试过,with dat as (SELECT '19:02' t1_contr from dual union all SELECT '19:26' t1_contr from dual union all SELECT '03:50' t1_contr from dual union all SELECT '08:30' t1_contr from dual union all SELECT '02:42' t1_contr from dual ) select to_char(sum(substr(t1_contr,1,2)) --sum the hours, then add + trunc(sum(substr(t1_contr,4,2))/60)) --the hours portion of the summed minutes ||':'|| -- put in your separator to_char( mod(sum(substr(t1_contr,4,2)),60)) --and append the summed minutes after removing the hours from dat 发生了同样的事情

1 个答案:

答案 0 :(得分:0)

不知道问题出在哪里,但我设法解决了。必须执行以下步骤之一,但是我不知道是哪个步骤: