Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: unsubscribe from subjects when destroying room
Browse files Browse the repository at this point in the history
  • Loading branch information
Raspincel committed Mar 7, 2024
1 parent ffb19cd commit 3f9b99d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/utils/use-store.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PublicSubject } from '../../services/stores/common/types';
import { useGlobalStore } from '../../services/stores/global';
import { Store, StoreType, StoresTypes } from '../types/stores.types';
import { Store, StoreType } from '../types/stores.types';

const stores = {
[StoreType.GLOBAL]: useGlobalStore,
Expand Down
1 change: 1 addition & 0 deletions src/components/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export abstract class BaseComponent extends Observable {
this.logger.log('detached');
this.publish(ComponentLifeCycleEvent.UNMOUNT);
this.destroy();
this.unsubscribeFrom.forEach((unsubscribe) => unsubscribe(this));

Object.values(this.observers).forEach((observer) => {
observer.reset();
Expand Down

0 comments on commit 3f9b99d

Please sign in to comment.