From 137b9c784c7b63e2163ec01aba3e699cd640a7df Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 10 Jan 2018 14:04:41 +0200 Subject: [PATCH] fix(aio): preserve static Observable methods (#21351) PR Close #21351 --- aio/src/app/search/search.service.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aio/src/app/search/search.service.ts b/aio/src/app/search/search.service.ts index 7febd9543e..51c349c787 100644 --- a/aio/src/app/search/search.service.ts +++ b/aio/src/app/search/search.service.ts @@ -7,9 +7,10 @@ can be found in the LICENSE file at http://angular.io/license import { NgZone, Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; import { ReplaySubject } from 'rxjs/ReplaySubject'; -import 'rxjs/add/observable/race'; -import 'rxjs/add/observable/timer'; +import { race } from 'rxjs/observable/race'; +import { timer } from 'rxjs/observable/timer'; import 'rxjs/add/operator/concatMap'; +import 'rxjs/add/operator/first'; import 'rxjs/add/operator/publishReplay'; import { WebWorkerClient } from 'app/shared/web-worker'; import { SearchResults } from 'app/search/interfaces'; @@ -30,11 +31,10 @@ export class SearchService { * @param initDelay the number of milliseconds to wait before we load the WebWorker and generate the search index */ initWorker(workerUrl: string, initDelay: number) { - const ready = this.ready = Observable - // Wait for the initDelay or the first search - .race( - Observable.timer(initDelay), - (this.searchesSubject as Observable).first() + // Wait for the initDelay or the first search + const ready = this.ready = race( + timer(initDelay), + (this.searchesSubject.asObservable()).first() ) .concatMap(() => { // Create the worker and load the index