1
0

61142: EditRelationshipList component to proper reload relationships and fix performance issues

This commit is contained in:
Kristof De Langhe
2019-04-08 15:28:18 +02:00
parent 01b60dbf34
commit bbbd6959a8
11 changed files with 332 additions and 75 deletions

View File

@@ -3,7 +3,7 @@ import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
import { applyPatch, Operation } from 'fast-json-patch';
import { combineLatest as observableCombineLatest, Observable } from 'rxjs';
import { distinctUntilChanged, filter, map, mergeMap, take, } from 'rxjs/operators';
import { distinctUntilChanged, filter, map, mergeMap, take, tap, } from 'rxjs/operators';
import { hasNoValue, hasValue, isNotEmpty } from '../../shared/empty.util';
import { CoreState } from '../core.reducers';
import { coreSelector } from '../core.selectors';
@@ -224,6 +224,18 @@ export class ObjectCacheService {
return result;
}
/**
* Create an observable that emits a new value whenever the availability of the cached object changes.
* The value it emits is a boolean stating if the object exists in cache or not.
* @param selfLink The self link of the object to observe
*/
hasBySelfLinkObservable(selfLink: string): Observable<boolean> {
return this.store.pipe(
select(entryFromSelfLinkSelector(selfLink)),
map((entry: ObjectCacheEntry) => this.isValid(entry))
);
}
/**
* Check whether an ObjectCacheEntry should still be cached
*