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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user