2
concat
コールの処理は何ですか?私がconcat
をmerge
に置き換えた場合、コードは正しく動作し、出力はfoo
bar
qux
quux
です。ホットとコールドの観測値については読んだことがあります。値がサブスクリプションの前に生成された場合に発生する可能性のあるホットな観測値については、私の観測値はcoldであることがわかります。RxJS観測可能なコンカットが動作しない
const Rx = require('rxjs');
const observable1 = Rx.Observable.create((observer) => {
observer.next('foo');
observer.next('bar');
return observer;
});
const observable2 = Rx.Observable.create((observer) => {
observer.next('qux');
observer.next('quux');
return observer;
});
const result1 = observable1.concat(observable2);
result1.subscribe((x) => console.log(x));
// outputs
foo
bar
https://codepen.io/thiagoh/pen/WZyrRL
ありがとうございました。それが必要な理由を確認/説明するための資料がありますか? – thiagoh
@thiagohこれは 'concat()'メソッドの通常の動作です。 '** previous completed **、emit values .'のようにobservablesを購読する - https://www.learnrxjs.io/operators/combination/concat.html –
大理石の図は、視覚的にも優れています[Concat ](http://reactivex.io/documentation/operators/concat.html) –