Skip to content

Instantly share code, notes, and snippets.

@tusharmath
Last active January 12, 2017 23:58
Show Gist options
  • Save tusharmath/dae749a4d12d3a78a8685404ed7f3740 to your computer and use it in GitHub Desktop.
Save tusharmath/dae749a4d12d3a78a8685404ed7f3740 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<!-- put markup and other contents here -->
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
import {Observable as O} from 'rx'
import {rxRAFThrottle} from 'rx-raf-throttle'
const t = O.interval(1).take(10)
t.subscribe(x => document.writeln(x + '<br/>'))
rxRAFThrottle(t).subscribe(x => document.writeln('raf(' + x + ')<br/>'))
{
"name": "esnextbin-sketch-rx-raf-throttle-demo",
"dependencies": {
"rx": "4.1.0",
"rx-raf-throttle": "1.0.0"
},
"version": "0.0.0"
}
'use strict';
var _rx = require('rx');
var _rxRafThrottle = require('rx-raf-throttle');
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
var t = _rx.Observable.interval(1).take(10);
t.subscribe(function (x) {
return document.writeln(x + '<br/>');
});
(0, _rxRafThrottle.rxRAFThrottle)(t).subscribe(function (x) {
return document.writeln('raf(' + x + ')<br/>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment