Skip to content

Instantly share code, notes, and snippets.

@tusharmath
Last active April 23, 2017 08:42
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 tusharmath/0a7c3ce7e42090dfca0b917a108f2561 to your computer and use it in GitHub Desktop.
Save tusharmath/0a7c3ce7e42090dfca0b917a108f2561 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 * as O from 'observable-air'
import * as R from 'ramda'
const even = R.compose(
O.slice(0, 5),
O.scan(R.add(2), -2),
O.interval
)
O.forEach(i => console.log(Date.now(), i), even(100))
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"observable-air": "4.2.0",
"ramda": "0.23.0"
}
}
'use strict';
var _observableAir = require('observable-air');
var O = _interopRequireWildcard(_observableAir);
var _ramda = require('ramda');
var R = _interopRequireWildcard(_ramda);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
var even = R.compose(O.slice(0, 5), O.scan(R.add(2), -2), O.interval);
O.forEach(function (i) {
return console.log(Date.now(), i);
}, even(100));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment