Open hsiaofung opened 4 years ago
interval(1000)
=> ---0---1---2---3---Rx.Observable.of(1,2,3,4)
=> (1234)|var source = Rx.Observable.interval(1000);
var newest = source.map(x=>x+1);
source : ---0---1---2---3---
map(x=>x+1)
newest : ---1---2---3---4---var observable = Rx.interval(1000)
const mySubscription = observable.subscribe(result => console.log(result))
setTimeout(() =>{ mySubscription.unsubscribe(); }, 1000 )
什麼是RXJS?
How to use RxJs for building applications in reactive style ?