Created
August 18, 2019 14:17
-
-
Save web2ls/658682ac9f36e1b40fe9ae39f7ce26fd to your computer and use it in GitHub Desktop.
Hot Observable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as Rx from "rxjs"; | |
| const observable = Rx.Observable.fromEvent(document, 'click'); | |
| // subscription 1 | |
| observable.subscribe((event) => { | |
| console.log(event.clientX); // x position of click | |
| }); | |
| // subscription 2 | |
| observable.subscribe((event) => { | |
| console.log(event.clientY); // y position of click | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment