Skip to content

Instantly share code, notes, and snippets.

@TylorS
Last active May 16, 2017 15:51
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/efc15da333f4bc5e9f449efff62c7202 to your computer and use it in GitHub Desktop.
Save TylorS/efc15da333f4bc5e9f449efff62c7202 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>
import { mergeConcurrently, from, multicast, take } from 'most'
import { hold } from 'most-subject'
import { range, map } from '167'
console.clear()
const concatAll = (...streams) => mergeConcurrently(1, from(map(hold(1), streams)))
const a = from(range(1, 10))
concatAll(take(3, a), a).observe(console.log)
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"167": "0.7.0",
"most": "1.2.2",
"most-subject": "5.3.0"
}
}
'use strict';
var _ = require('167');
var _most = require('most');
var _mostSubject = require('most-subject');
console.clear();
var concatAll = function concatAll() {
for (var _len = arguments.length, streams = Array(_len), _key = 0; _key < _len; _key++) {
streams[_key] = arguments[_key];
}
return (0, _most.mergeConcurrently)(1, (0, _most.from)((0, _.map)((0, _mostSubject.hold)(1), streams)));
};
var a = (0, _most.from)((0, _.range)(1, 10));
concatAll((0, _most.take)(3, a), a).observe(console.log);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment