Delete from entities map
This commit is contained in:
parent
d141625d5f
commit
4d045682ab
@ -10,13 +10,16 @@ export abstract class EntitiesMapService<E extends Entity<I>, I> {
|
||||
private readonly _entityChanged$ = new Subject<E>();
|
||||
private readonly _entityDeleted$ = new Subject<E>();
|
||||
|
||||
protected constructor(@Inject('ENTITY_PRIMARY_KEY') protected readonly _primaryKey: string) {
|
||||
}
|
||||
protected constructor(@Inject('ENTITY_PRIMARY_KEY') protected readonly _primaryKey: string) {}
|
||||
|
||||
get empty(): boolean {
|
||||
return this._map.size === 0;
|
||||
}
|
||||
|
||||
delete(keys: string[]): void {
|
||||
keys.forEach(key => this._map.delete(key));
|
||||
}
|
||||
|
||||
get$(key: string) {
|
||||
if (!this._map.has(key)) {
|
||||
this._map.set(key, new BehaviorSubject<E[]>([]));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user