1
- import { Observable } from '../Observable' ;
2
- import { MonoTypeOperatorFunction } from '../types' ;
1
+ import { MonoTypeOperatorFunction , ObservableInput } from '../types' ;
3
2
import { operate } from '../util/lift' ;
4
3
import { createOperatorSubscriber } from './OperatorSubscriber' ;
5
4
import { innerFrom } from '../observable/innerFrom' ;
@@ -8,19 +7,22 @@ import { noop } from '../util/noop';
8
7
/**
9
8
* Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
10
9
*
11
- * The `skipUntil` operator causes the observable stream to skip the emission of values until the passed in observable emits the first value.
12
- * This can be particularly useful in combination with user interactions, responses of http requests or waiting for specific times to pass by.
10
+ * The `skipUntil` operator causes the observable stream to skip the emission of values until the passed in observable
11
+ * emits the first value. This can be particularly useful in combination with user interactions, responses of HTTP
12
+ * requests or waiting for specific times to pass by.
13
13
*
14
14
* 
15
15
*
16
- * Internally the `skipUntil` operator subscribes to the passed in observable (in the following called *notifier*) in order to recognize the emission
17
- * of its first value. When this happens, the operator unsubscribes from the *notifier* and starts emitting the values of the *source*
18
- * observable. It will never let the *source* observable emit any values if the *notifier* completes or throws an error without emitting
19
- * a value before.
16
+ * Internally, the `skipUntil` operator subscribes to the passed in `notifier` `ObservableInput` (which gets converted
17
+ * to an Observable) in order to recognize the emission of its first value. When `notifier` emits next, the operator
18
+ * unsubscribes from it and starts emitting the values of the *source* observable until it completes or errors. It
19
+ * will never let the *source* observable emit any values if the `notifier` completes or throws an error without
20
+ * emitting a value before.
20
21
*
21
22
* ## Example
22
23
*
23
- * In the following example, all emitted values of the interval observable are skipped until the user clicks anywhere within the page
24
+ * In the following example, all emitted values of the interval observable are skipped until the user clicks anywhere
25
+ * within the page
24
26
*
25
27
* ```ts
26
28
* import { interval, fromEvent, skipUntil } from 'rxjs';
@@ -41,13 +43,13 @@ import { noop } from '../util/noop';
41
43
* @see {@link skipWhile }
42
44
* @see {@link skipLast }
43
45
*
44
- * @param { Observable } notifier - The second Observable that has to emit an item before the source Observable's elements begin to
46
+ * @param notifier An `ObservableInput` that has to emit an item before the source Observable elements begin to
45
47
* be mirrored by the resulting Observable.
46
48
* @return A function that returns an Observable that skips items from the
47
- * source Observable until the second Observable emits an item, then emits the
49
+ * source Observable until the `notifier` Observable emits an item, then emits the
48
50
* remaining items.
49
51
*/
50
- export function skipUntil < T > ( notifier : Observable < any > ) : MonoTypeOperatorFunction < T > {
52
+ export function skipUntil < T > ( notifier : ObservableInput < any > ) : MonoTypeOperatorFunction < T > {
51
53
return operate ( ( source , subscriber ) => {
52
54
let taking = false ;
53
55
0 commit comments