mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 11:33:04 +00:00
Merge pull request #166 from artlowel/remote-data-inital-state-issue
fixed an issue where the remote data state observable would only fire…
This commit is contained in:
@@ -49,12 +49,20 @@ export class RemoteDataBuildService {
|
|||||||
requestHrefObs.flatMap((requestHref) => this.responseCache.get(requestHref)).filter((entry) => hasValue(entry))
|
requestHrefObs.flatMap((requestHref) => this.responseCache.get(requestHref)).filter((entry) => hasValue(entry))
|
||||||
);
|
);
|
||||||
|
|
||||||
const requestPending = requestObs.map((entry: RequestEntry) => entry.requestPending).distinctUntilChanged();
|
const requestPending = requestObs
|
||||||
|
.map((entry: RequestEntry) => entry.requestPending)
|
||||||
|
.startWith(true)
|
||||||
|
.distinctUntilChanged();
|
||||||
|
|
||||||
const responsePending = requestObs.map((entry: RequestEntry) => entry.responsePending).distinctUntilChanged();
|
const responsePending = requestObs
|
||||||
|
.map((entry: RequestEntry) => entry.responsePending)
|
||||||
|
.startWith(false)
|
||||||
|
.distinctUntilChanged();
|
||||||
|
|
||||||
const isSuccessFul = responseCacheObs
|
const isSuccessFul = responseCacheObs
|
||||||
.map((entry: ResponseCacheEntry) => entry.response.isSuccessful).distinctUntilChanged();
|
.map((entry: ResponseCacheEntry) => entry.response.isSuccessful)
|
||||||
|
.startWith(false)
|
||||||
|
.distinctUntilChanged();
|
||||||
|
|
||||||
const errorMessage = responseCacheObs
|
const errorMessage = responseCacheObs
|
||||||
.filter((entry: ResponseCacheEntry) => !entry.response.isSuccessful)
|
.filter((entry: ResponseCacheEntry) => !entry.response.isSuccessful)
|
||||||
@@ -133,12 +141,20 @@ export class RemoteDataBuildService {
|
|||||||
const responseCacheObs = hrefObs.flatMap((href: string) => this.responseCache.get(href))
|
const responseCacheObs = hrefObs.flatMap((href: string) => this.responseCache.get(href))
|
||||||
.filter((entry) => hasValue(entry));
|
.filter((entry) => hasValue(entry));
|
||||||
|
|
||||||
const requestPending = requestObs.map((entry: RequestEntry) => entry.requestPending).distinctUntilChanged();
|
const requestPending = requestObs
|
||||||
|
.map((entry: RequestEntry) => entry.requestPending)
|
||||||
|
.startWith(true)
|
||||||
|
.distinctUntilChanged();
|
||||||
|
|
||||||
const responsePending = requestObs.map((entry: RequestEntry) => entry.responsePending).distinctUntilChanged();
|
const responsePending = requestObs
|
||||||
|
.map((entry: RequestEntry) => entry.responsePending)
|
||||||
|
.startWith(false)
|
||||||
|
.distinctUntilChanged();
|
||||||
|
|
||||||
const isSuccessFul = responseCacheObs
|
const isSuccessFul = responseCacheObs
|
||||||
.map((entry: ResponseCacheEntry) => entry.response.isSuccessful).distinctUntilChanged();
|
.map((entry: ResponseCacheEntry) => entry.response.isSuccessful)
|
||||||
|
.startWith(false)
|
||||||
|
.distinctUntilChanged();
|
||||||
|
|
||||||
const errorMessage = responseCacheObs
|
const errorMessage = responseCacheObs
|
||||||
.filter((entry: ResponseCacheEntry) => !entry.response.isSuccessful)
|
.filter((entry: ResponseCacheEntry) => !entry.response.isSuccessful)
|
||||||
|
Reference in New Issue
Block a user