RxJS Subject
Subjectは、Observable + Observer である。
Subjectはユニキャストできる。
Subjectは、Subjectオブジェクト作成後、後々ストリームを流せる。
Observableオブジェクトより、使い勝手が良さそう?
let sbj = new Subject sbj.subscribe((val) => console.log(val)) sbj.subscribe((val) => console.log(val * 10)) sbj.next(1) // 1, 10 sbj.next(2) // 2, 20 sbj.next(3) // 3, 30