Created
July 2, 2018 16:12
-
-
Save byteshiva/892b6c2f3120866b0b8690019b1424f3 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/cujame
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<button>Click Me</button> | |
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script> | |
<script id="jsbin-javascript"> | |
var button = document.querySelector('button'); | |
//button.addEventListener('click', (e) => {console.log(e);}); | |
Rx.Observable.fromEvent(button, 'click') | |
.throttleTime(1000) | |
.map((data) => {return data.clientY;}) | |
.subscribe((coordinate) => console.log(coordinate)); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var button = document.querySelector('button'); | |
//button.addEventListener('click', (e) => {console.log(e);}); | |
Rx.Observable.fromEvent(button, 'click') | |
.throttleTime(1000) | |
.map((data) => {return data.clientY;}) | |
.subscribe((coordinate) => console.log(coordinate));</script></body> | |
</html> |
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
var button = document.querySelector('button'); | |
//button.addEventListener('click', (e) => {console.log(e);}); | |
Rx.Observable.fromEvent(button, 'click') | |
.throttleTime(1000) | |
.map((data) => {return data.clientY;}) | |
.subscribe((coordinate) => console.log(coordinate)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment