Cel*_*Cel 6 reactive-programming observable rxjs rxjs5 angular
如何从Data和Gate中获取Out observable?
受本文贡献的启发,以下内容似乎产生了所需的行为:
const ticks$ = gates$.filter(b => b)
const crosses$ = gates$.filter(b => !b)
const tickedData$ = data$.windowToggle(ticks$, _ => crosses$.take(1)).switch()
const crossedDataBuffers$ = data$.bufferToggle(crosses$, _ => ticks$.take(1))
const crossedData$ = Rx.Observable.from(crossedDataBuffers$)
const out$ = tickedData$.merge(crossedData$)
Run Code Online (Sandbox Code Playgroud)
它可能会变得更简单,可以玩一下https://jsfiddle.net/KristjanLaane/6kbgnp41/
| 归档时间: |
|
| 查看次数: |
2197 次 |
| 最近记录: |