Tobias Kausch
@tobikabla
JS/Angular/Ionic/Cordova
a paradigm about streaming of async data and propagation of change
Think of RxJS as Lodash for events.
const observable$ = from([1, 2, 3, 4, 5]);
//output: 1,2,3,4,5
const observable$ = fromEvent(document, 'click');
const observable$ = interval(1000);
//output: 0,1,2,3,4,5....
Helper Functions
//emit (1,2,3,4,5)
const source$ = from([1, 2, 3, 4, 5]);
//add 10 to each value
const example$ = source$.pipe(map(val => val + 10));
//output: 11,12,13,14,15
const subscribe = example$.subscribe(val => console.log(val));
Let's dive into the code