Modification de la récupération des sauts et mapping entre les IDs des données référentielles et les données présentes dans le cache.

This commit is contained in:
Sébastien André
2021-05-02 15:00:11 +02:00
parent 192a985b50
commit f59d1828ca
9 changed files with 70 additions and 15 deletions

View File

@@ -14,11 +14,7 @@ export class ServiceCacheApi {
this.cache = new Map<CacheApiKey, Observable<any>>();
}
public get<T>(key: CacheApiKey, callToApi: Observable<T>, withResetCache: boolean = false) : Observable<T> {
if (withResetCache === true) {
this.cache.delete(key);
}
public get<T>(key: CacheApiKey, callToApi: Observable<T>) : Observable<T> {
const cached = this.cache.get(key);
if (cached) {
@@ -34,4 +30,8 @@ export class ServiceCacheApi {
public delete(key: CacheApiKey) {
this.cache.delete(key);
}
public getByKey<T>(key: CacheApiKey) : Observable<T> {
return this.cache.get(key);
}
}