From a37a918130d7051b420393d710e60584742c7b5f Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 24 Jan 2019 17:24:07 +0100 Subject: [PATCH] Replaced filter and take rxjs operators with first rxjs operator --- src/app/core/data/data.service.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index f830709936..0e9e22f0e9 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -1,4 +1,4 @@ -import { distinctUntilChanged, filter, first, map, take } from 'rxjs/operators'; +import { distinctUntilChanged, filter, first, map } from 'rxjs/operators'; import { Observable } from 'rxjs'; import { Store } from '@ngrx/store'; @@ -81,8 +81,7 @@ export abstract class DataService const hrefObs = this.getFindAllHref(options); hrefObs.pipe( - filter((href: string) => hasValue(href)), - take(1)) + first((href: string) => hasValue(href))) .subscribe((href: string) => { const request = new FindAllRequest(this.requestService.generateRequestId(), href, options); this.requestService.configure(request, this.forceBypassCache); @@ -125,8 +124,7 @@ export abstract class DataService const hrefObs = this.getSearchByHref(searchMethod, options); hrefObs.pipe( - filter((href: string) => hasValue(href)), - take(1)) + first((href: string) => hasValue(href))) .subscribe((href: string) => { const request = new FindAllRequest(this.requestService.generateRequestId(), href, options); this.requestService.configure(request, true);