switched to self links as keys in the object cache

This commit is contained in:
Art Lowel
2017-09-15 18:02:29 +02:00
parent f6ca6e6136
commit 0d4b064541
19 changed files with 236 additions and 231 deletions

View File

@@ -70,10 +70,10 @@ export class RemoteDataBuildService {
this.objectCache.getBySelfLink<TNormalized>(href, normalizedType).startWith(undefined),
responseCacheObs
.filter((entry: ResponseCacheEntry) => entry.response.isSuccessful)
.map((entry: ResponseCacheEntry) => (entry.response as SuccessResponse).resourceUUIDs)
.flatMap((resourceUUIDs: string[]) => {
if (isNotEmpty(resourceUUIDs)) {
return this.objectCache.get(resourceUUIDs[0], normalizedType);
.map((entry: ResponseCacheEntry) => (entry.response as SuccessResponse).resourceSelfLinks)
.flatMap((resourceSelfLinks: string[]) => {
if (isNotEmpty(resourceSelfLinks)) {
return this.objectCache.getBySelfLink(resourceSelfLinks[0], normalizedType);
} else {
return Observable.of(undefined);
}
@@ -137,7 +137,7 @@ export class RemoteDataBuildService {
const payload = responseCacheObs
.filter((entry: ResponseCacheEntry) => entry.response.isSuccessful)
.map((entry: ResponseCacheEntry) => (entry.response as SuccessResponse).resourceUUIDs)
.map((entry: ResponseCacheEntry) => (entry.response as SuccessResponse).resourceSelfLinks)
.flatMap((resourceUUIDs: string[]) => {
return this.objectCache.getList(resourceUUIDs, normalizedType)
.map((normList: TNormalized[]) => {