made with esnextbin
Last active
March 8, 2016 00:42
-
-
Save TylorS/0de3742d22f2094b9f86 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
```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)) | |
``` |
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", | |
"version": "0.0.0", | |
"dependencies": { | |
"babel-runtime": "6.6.1" | |
} | |
} |
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 _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