mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
bd6c99da2e
commit
d109a5aeb2
@@ -6,7 +6,6 @@ import { hasValue, isEmpty, isNotEmpty } from '../../shared/empty.util';
|
|||||||
import { RESTURLCombiner } from '../url-combiner/rest-url-combiner';
|
import { RESTURLCombiner } from '../url-combiner/rest-url-combiner';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { EndpointMap } from '../cache/response.models';
|
import { EndpointMap } from '../cache/response.models';
|
||||||
import { getFirstCompletedRemoteData } from './operators';
|
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { CacheableObject } from '../cache/cacheable-object.model';
|
import { CacheableObject } from '../cache/cacheable-object.model';
|
||||||
@@ -37,8 +36,8 @@ export class HALEndpointService {
|
|||||||
// This skip ensures that if a stale object is present in the cache when you do a
|
// This skip ensures that if a stale object is present in the cache when you do a
|
||||||
// call it isn't immediately returned, but we wait until the remote data for the new request
|
// call it isn't immediately returned, but we wait until the remote data for the new request
|
||||||
// is created.
|
// is created.
|
||||||
skipWhile((rd: RemoteData<CacheableObject>) => rd.isStale),
|
skipWhile((rd: RemoteData<CacheableObject>) => rd.isLoading || rd.isStale),
|
||||||
getFirstCompletedRemoteData(),
|
take(1),
|
||||||
map((response: RemoteData<CacheableObject>) => {
|
map((response: RemoteData<CacheableObject>) => {
|
||||||
if (hasValue(response.payload)) {
|
if (hasValue(response.payload)) {
|
||||||
return response.payload._links;
|
return response.payload._links;
|
||||||
|
Reference in New Issue
Block a user