关于RXjs多播实例
2017-11-23 本文已影响0人
infi_
var test=Rx.Observable.create(function(observer){
observer.next("hello")
observer.next("some")
observer.next("hi")
})
var test2=new Rx.Subject()
var share=test.multicast(test2)
var person1=share.subscribe({
next:function(x){console.log(x)}
})
var person2=share.subscribe({
next:function(x){console.log(x+"word");person1.unsubscribe()}
})
share.connect()