What can i say about rxjs?
Rxjs it is a different way of writing the code
For instance, instead of doing this:
document.querySelector('h1').addEventListener('click',(e)=>{
alert()
})
With Rxjs you can write the same thing using this code:
Rx.Observable.fromEvent(document.querySelector('h1'),'click').subscribe((x)=>{
alert()
})
So whats the advantage of using rxjs?
One of the advantages - is that you can use plenty of various utils which helps you:
For example if you want you code to respond not more than one events per second you can simply write this code:
Rx.Observable.fromEvent(window,'resize')
.throttleTime(1000)
.subscribe((x)=>{
document.querySelector('h1').innerText =window.outerHeight
})
Which is nicelink to running code