diff --git a/src/internal/observable/generate.ts b/src/internal/observable/generate.ts index 2d9f9f0ffe..ff461e70a2 100644 --- a/src/internal/observable/generate.ts +++ b/src/internal/observable/generate.ts @@ -336,7 +336,7 @@ export function generate(options: GenerateOptions): Observable; export function generate(initialStateOrOptions: S | GenerateOptions, condition?: ConditionFunc, iterate?: IterateFunc, - resultSelectorOrObservable?: (ResultFunc) | SchedulerLike, + resultSelectorOrScheduler?: (ResultFunc) | SchedulerLike, scheduler?: SchedulerLike): Observable { let resultSelector: ResultFunc; @@ -349,13 +349,13 @@ export function generate(initialStateOrOptions: S | GenerateOptions, iterate = options.iterate; resultSelector = options.resultSelector || identity as ResultFunc; scheduler = options.scheduler; - } else if (resultSelectorOrObservable === undefined || isScheduler(resultSelectorOrObservable)) { + } else if (resultSelectorOrScheduler === undefined || isScheduler(resultSelectorOrScheduler)) { initialState = initialStateOrOptions as S; resultSelector = identity as ResultFunc; - scheduler = resultSelectorOrObservable as SchedulerLike; + scheduler = resultSelectorOrScheduler as SchedulerLike; } else { initialState = initialStateOrOptions as S; - resultSelector = resultSelectorOrObservable as ResultFunc; + resultSelector = resultSelectorOrScheduler as ResultFunc; } return new Observable(subscriber => {