This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/papercraft/openjscad/node_modules/most/lib/combinator/concatMap.js

25 lines
881 B
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.concatMap = concatMap;
var _mergeConcurrently = require('./mergeConcurrently');
/**
* Map each value in stream to a new stream, and concatenate them all
* stream: -a---b---cX
* f(a): 1-1-1-1X
* f(b): -2-2-2-2X
* f(c): -3-3-3-3X
* stream.concatMap(f): -1-1-1-1-2-2-2-2-3-3-3-3X
* @param {function(x:*):Stream} f function to map each value to a stream
* @param {Stream} stream
* @returns {Stream} new stream containing all events from each stream returned by f
*/
function concatMap(f, stream) {
return (0, _mergeConcurrently.mergeMapConcurrently)(f, 1, stream);
} /** @license MIT License (c) copyright 2010-2016 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */