Autounsubscribe & entity updates
This commit is contained in:
parent
2c3eb9a005
commit
f8ef27c49d
@ -7,6 +7,10 @@ export abstract class Entity<I> implements IListable {
|
||||
|
||||
protected constructor(private readonly _interface: I) {}
|
||||
|
||||
get model(): I {
|
||||
return this._interface;
|
||||
}
|
||||
|
||||
isEqual(entity: Entity<I>): boolean {
|
||||
return JSON.stringify(this._interface) === JSON.stringify(entity?._interface);
|
||||
}
|
||||
|
||||
@ -17,6 +17,10 @@ export abstract class AutoUnsubscribe implements OnDestroy {
|
||||
this._subscriptions.add(subscription);
|
||||
}
|
||||
|
||||
set removeSubscription(subscription: Subscription) {
|
||||
this._subscriptions.remove(subscription);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method unsubscribes active subscriptions
|
||||
* If you implement OnDestroy in a component that inherits AutoUnsubscribeComponent,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user