Entities map service updates

This commit is contained in:
Adina Țeudan 2022-02-10 21:49:59 +02:00
parent 492ac8d7c0
commit b040815b85

View File

@ -12,6 +12,10 @@ export abstract class EntitiesMapService<E extends Entity<I>, 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<E[]>([]));
@ -20,8 +24,8 @@ export abstract class EntitiesMapService<E extends Entity<I>, 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[];