Autounsubscribe & entity updates

This commit is contained in:
Adina Țeudan 2021-11-03 01:17:38 +02:00
parent 2c3eb9a005
commit f8ef27c49d
2 changed files with 8 additions and 0 deletions

View File

@ -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);
}

View File

@ -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,