Skip to content

Instantly share code, notes, and snippets.

@TylorS
Last active March 8, 2016 00: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 TylorS/0de3742d22f2094b9f86 to your computer and use it in GitHub Desktop.
Save TylorS/0de3742d22f2094b9f86 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>
```js
import {empty, continueWith} from 'most'
function repeat(n, stream) {
let i = 0
return continueWith(() => {
if (i++ <= n) {
return stream
}
return empty()
}, stream)
}
const a$ = most.from([1, 2, 3])
repeat(2, a$).observe(x => console.log(x))
```
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"babel-runtime": "6.6.1"
}
}
"use strict";
var _templateObject = (0, _taggedTemplateLiteral3.default)([""], [""]),
_templateObject2 = (0, _taggedTemplateLiteral3.default)(["js\nimport {empty, continueWith} from 'most'\n\nfunction repeat(n, stream) {\n let i = 0\n return continueWith(() => {\n if (i++ <= n) {\n return stream\n } \n return empty()\n }, stream)\n}\n\nconst a$ = most.from([1, 2, 3])\n\nrepeat(2, a$).observe(x => console.log(x))\n"], ["js\nimport {empty, continueWith} from 'most'\n\nfunction repeat(n, stream) {\n let i = 0\n return continueWith(() => {\n if (i++ <= n) {\n return stream\n } \n return empty()\n }, stream)\n}\n\nconst a$ = most.from([1, 2, 3])\n\nrepeat(2, a$).observe(x => console.log(x))\n"]);
var _taggedTemplateLiteral2 = require("babel-runtime/helpers/taggedTemplateLiteral");
var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
""(_templateObject2)(_templateObject);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment