UNPKG

1.38 kBTypeScriptView Raw
1import { Operator, Stream } from '../index';
2export declare class DropUntilOperator<T> implements Operator<T, T> {
3 o: Stream<any>;
4 ins: Stream<T>;
5 type: string;
6 out: Stream<T>;
7 private oil;
8 private on;
9 constructor(o: Stream<any>, ins: Stream<T>);
10 _start(out: Stream<T>): void;
11 _stop(): void;
12 up(): void;
13 _n(t: T): void;
14 _e(err: any): void;
15 _c(): void;
16}
17/**
18 * Starts emitting the input stream when another stream emits a next event. The
19 * output stream will complete if/when the other stream completes.
20 *
21 * Marble diagram:
22 *
23 * ```text
24 * ---1---2-----3--4----5----6---
25 * dropUntil( --------a--b--| )
26 * ---------------------5----6|
27 * ```
28 *
29 * Example:
30 *
31 * ```js
32 * import dropUntil from 'xstream/extra/dropUntil'
33 *
34 * const other = xs.periodic(220).take(1)
35 *
36 * const stream = xs.periodic(50)
37 * .take(6)
38 * .compose(dropUntil(other))
39 *
40 * stream.addListener({
41 * next: i => console.log(i),
42 * error: err => console.error(err),
43 * complete: () => console.log('completed')
44 * })
45 * ```
46 *
47 * ```text
48 * > 4
49 * > 5
50 * > completed
51 * ```
52 *
53 * #### Arguments:
54 *
55 * @param {Stream} other Some other stream that is used to know when should the
56 * output stream of this operator start emitting.
57 * @return {Stream}
58 */
59export default function dropUntil<T>(other: Stream<any>): (ins: Stream<T>) => Stream<T>;