mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
Replaced filter and take rxjs operators with first rxjs operator
This commit is contained in:
@@ -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 { Observable } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
@@ -81,8 +81,7 @@ export abstract class DataService<TNormalized extends NormalizedObject, TDomain>
|
|||||||
const hrefObs = this.getFindAllHref(options);
|
const hrefObs = this.getFindAllHref(options);
|
||||||
|
|
||||||
hrefObs.pipe(
|
hrefObs.pipe(
|
||||||
filter((href: string) => hasValue(href)),
|
first((href: string) => hasValue(href)))
|
||||||
take(1))
|
|
||||||
.subscribe((href: string) => {
|
.subscribe((href: string) => {
|
||||||
const request = new FindAllRequest(this.requestService.generateRequestId(), href, options);
|
const request = new FindAllRequest(this.requestService.generateRequestId(), href, options);
|
||||||
this.requestService.configure(request, this.forceBypassCache);
|
this.requestService.configure(request, this.forceBypassCache);
|
||||||
@@ -125,8 +124,7 @@ export abstract class DataService<TNormalized extends NormalizedObject, TDomain>
|
|||||||
const hrefObs = this.getSearchByHref(searchMethod, options);
|
const hrefObs = this.getSearchByHref(searchMethod, options);
|
||||||
|
|
||||||
hrefObs.pipe(
|
hrefObs.pipe(
|
||||||
filter((href: string) => hasValue(href)),
|
first((href: string) => hasValue(href)))
|
||||||
take(1))
|
|
||||||
.subscribe((href: string) => {
|
.subscribe((href: string) => {
|
||||||
const request = new FindAllRequest(this.requestService.generateRequestId(), href, options);
|
const request = new FindAllRequest(this.requestService.generateRequestId(), href, options);
|
||||||
this.requestService.configure(request, true);
|
this.requestService.configure(request, true);
|
||||||
|
Reference in New Issue
Block a user