1
1
import { Observable } from '../Observable' ;
2
+ import { innerFrom } from '../observable/innerFrom' ;
2
3
import { Subject } from '../Subject' ;
3
4
import { Subscription } from '../Subscription' ;
4
5
5
- import { MonoTypeOperatorFunction } from '../types' ;
6
+ import { MonoTypeOperatorFunction , ObservableInput } from '../types' ;
6
7
import { operate } from '../util/lift' ;
7
8
import { createOperatorSubscriber } from './OperatorSubscriber' ;
8
9
@@ -33,13 +34,13 @@ import { createOperatorSubscriber } from './OperatorSubscriber';
33
34
* @see {@link retry }
34
35
* @see {@link retryWhen }
35
36
*
36
- * @param { function(notifications: Observable): Observable } notifier - Receives an Observable of notifications with
37
+ * @param notifier function that receives an Observable of notifications with
37
38
* which a user can `complete` or `error`, aborting the repetition.
38
- * @return A function that returns an Observable that mirrors the source
39
+ * @return A function that returns an `ObservableInput` that mirrors the source
39
40
* Observable with the exception of a `complete`.
40
41
* @deprecated Will be removed in v9 or v10. Use {@link repeat}'s `delay` option instead.
41
42
*/
42
- export function repeatWhen < T > ( notifier : ( notifications : Observable < void > ) => Observable < any > ) : MonoTypeOperatorFunction < T > {
43
+ export function repeatWhen < T > ( notifier : ( notifications : Observable < void > ) => ObservableInput < any > ) : MonoTypeOperatorFunction < T > {
43
44
return operate ( ( source , subscriber ) => {
44
45
let innerSub : Subscription | null ;
45
46
let syncResub = false ;
@@ -61,7 +62,7 @@ export function repeatWhen<T>(notifier: (notifications: Observable<void>) => Obs
61
62
62
63
// If the call to `notifier` throws, it will be caught by the OperatorSubscriber
63
64
// In the main subscription -- in `subscribeForRepeatWhen`.
64
- notifier ( completions$ ) . subscribe (
65
+ innerFrom ( notifier ( completions$ ) ) . subscribe (
65
66
createOperatorSubscriber (
66
67
subscriber ,
67
68
( ) => {
0 commit comments