ForkJoin并没有像预期的那样工作

时间:2018-02-12 12:49:40

标签: rxjs

为什么这样的代码只打印一个' 0'?如何让它先打印两个零然后完成?

const example = Rx.Observable.forkJoin(
      Rx.Observable.interval(500).takeWhile((val) => {
                console.log(val);
                return false;}).takeUntil(Rx.Observable.timer(30000)),
      Rx.Observable.interval(500).takeWhile((val) => {
                console.log(val);
                return  false;}).takeUntil(Rx.Observable.timer(30000))
    );
    const subscribe = example.subscribe(val => console.log(val));

jsFiddle

0 个答案:

没有答案