Skip to content

Instantly share code, notes, and snippets.

@samcyn
Last active February 14, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samcyn/8223427ec5fe15a514d2fbee991995fa to your computer and use it in GitHub Desktop.
Save samcyn/8223427ec5fe15a514d2fbee991995fa to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/kisodag
var button = document.querySelector('button');
Rx.Observable.fromEvent(button, 'click')
.throttleTime(1000)
.map( (data) => { return data.clientY })
.subscribe(
(coordinate) => console.log(coordinate)
);
<!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>
</body>
</html>
@samcyn
Copy link
Author

samcyn commented Feb 14, 2018

RXJS BASIC EXPLAINED EASILY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment