import { Stream } from '../index'; /** * Puts one stream after the other. *concat* is a factory that takes multiple * streams as arguments, and starts the `n+1`-th stream only when the `n`-th * stream has completed. It concatenates those streams together. * * Marble diagram: * * ```text * --1--2---3---4-| * ...............--a-b-c--d-| * concat * --1--2---3---4---a-b-c--d-| * ``` * * Example: * * ```js * import concat from 'xstream/extra/concat' * * const streamA = xs.of('a', 'b', 'c') * const streamB = xs.of(10, 20, 30) * const streamC = xs.of('X', 'Y', 'Z') * * const outputStream = concat(streamA, streamB, streamC) * * outputStream.addListener({ * next: (x) => console.log(x), * error: (err) => console.error(err), * complete: () => console.log('concat completed'), * }) * ``` * * @factory true * @param {Stream} stream1 A stream to concatenate together with other streams. * @param {Stream} stream2 A stream to concatenate together with other streams. Two * or more streams may be given as arguments. * @return {Stream} */ export default function concat(...streams: Array>): Stream;