Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit eefc40e

Browse files
committed
Use IDestroyable instead of IDisposable
For consistency within our project
1 parent bed4766 commit eefc40e

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/components/views/rooms/NotificationBadge.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/models/event";
3131
import ActiveRoomObserver from "../../../ActiveRoomObserver";
3232
import { EventEmitter } from "events";
3333
import { arrayDiff } from "../../../utils/arrays";
34+
import { IDestroyable } from "../../../utils/IDestroyable";
3435

3536
export const NOTIFICATION_STATE_UPDATE = "update";
3637

@@ -106,7 +107,7 @@ export default class NotificationBadge extends React.PureComponent<IProps, IStat
106107
}
107108
}
108109

109-
export class RoomNotificationState extends EventEmitter {
110+
export class RoomNotificationState extends EventEmitter implements IDestroyable {
110111
private _symbol: string;
111112
private _count: number;
112113
private _color: NotificationColor;

src/stores/room-list/filters/CommunityFilterCondition.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import { Group } from "matrix-js-sdk/src/models/group";
2020
import { EventEmitter } from "events";
2121
import GroupStore from "../../GroupStore";
2222
import { arrayHasDiff } from "../../../utils/arrays";
23-
import { IDisposable } from "../../../utils/IDisposable";
23+
import { IDestroyable } from "../../../utils/IDestroyable";
2424

2525
/**
2626
* A filter condition for the room list which reveals rooms which
2727
* are a member of a given community.
2828
*/
29-
export class CommunityFilterCondition extends EventEmitter implements IFilterCondition, IDisposable {
29+
export class CommunityFilterCondition extends EventEmitter implements IFilterCondition, IDestroyable {
3030
private roomIds: string[] = [];
3131

3232
constructor(private community: Group) {
@@ -57,7 +57,7 @@ export class CommunityFilterCondition extends EventEmitter implements IFilterCon
5757
}
5858
};
5959

60-
public dispose(): void {
60+
public destroy(): void {
6161
GroupStore.off("update", this.onStoreUpdate);
6262
}
6363
}

src/utils/IDisposable.ts renamed to src/utils/IDestroyable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
export interface IDisposable {
18-
dispose(): void;
17+
export interface IDestroyable {
18+
destroy(): void;
1919
}

0 commit comments

Comments
 (0)