Skip to content

Instantly share code, notes, and snippets.

@byteshiva
Created July 2, 2018 16:12
Show Gist options
  • Save byteshiva/892b6c2f3120866b0b8690019b1424f3 to your computer and use it in GitHub Desktop.
Save byteshiva/892b6c2f3120866b0b8690019b1424f3 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/cujame
<!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>
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