A recipe for responding to a button click with an RxJS Observable. HTML <script> src=”https://unpkg.com/@reactivex/rxjs@5.3.0/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) // just for example, log the x position of the cursor ); The observable is created by the operator, fromEvent, which takes an “element” and an event […]