Understanding RxJS/ Observables

Understand Observables and how to use them

by Shital Agarwal

HTML

<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script>

<button>Click me</button>

JavaScript

var button = document.querySelector('button');

Rx.Observable.fromEvent(button, 'click')
	.subscribe(
  	(value) => console.log(value.clientX)
  );