From b040815b8568d8a4fce8faef2afc57fe6fce2e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 10 Feb 2022 21:49:59 +0200 Subject: [PATCH] Entities map service updates --- src/lib/services/entities-map.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/services/entities-map.service.ts b/src/lib/services/entities-map.service.ts index 031e557..44ee10c 100644 --- a/src/lib/services/entities-map.service.ts +++ b/src/lib/services/entities-map.service.ts @@ -12,6 +12,10 @@ export abstract class EntitiesMapService, I> { protected constructor(@Inject('ENTITY_PRIMARY_KEY') protected readonly _primaryKey: string) {} + get empty(): boolean { + return this._map.size === 0; + } + get$(key: string) { if (!this._map.has(key)) { this._map.set(key, new BehaviorSubject([])); @@ -20,8 +24,8 @@ export abstract class EntitiesMapService, I> { return this._getBehaviourSubject(key).asObservable(); } - has(dossierId: string) { - return this._map.has(dossierId); + has(parentId: string) { + return this._map.has(parentId); } get(key: string): E[];