made with esnextbin
Last active
January 12, 2017 23:58
-
-
Save tusharmath/dae749a4d12d3a78a8685404ed7f3740 to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains 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"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<!-- put markup and other contents here --> | |
</body> | |
</html> |
This file contains 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
// 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/>')) |
This file contains 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
{ | |
"name": "esnextbin-sketch-rx-raf-throttle-demo", | |
"dependencies": { | |
"rx": "4.1.0", | |
"rx-raf-throttle": "1.0.0" | |
}, | |
"version": "0.0.0" | |
} |
This file contains 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
'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