Skip to content

Commit

Permalink
♻️ [EmittenProtected] Mark private members as readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Oct 31, 2023
1 parent fb2d2c2 commit 55f0b2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EmittenProtected.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {EmittenMap, EmittenLibrary} from './types';

export class EmittenProtected<T extends EmittenMap> {
#multiLibrary: EmittenLibrary<T> = new Map();
#singleLibrary: EmittenLibrary<T> = new Map();
readonly #multiLibrary: EmittenLibrary<T> = new Map();
readonly #singleLibrary: EmittenLibrary<T> = new Map();

protected get activeEvents() {
// This redundant getter + method are required
Expand Down Expand Up @@ -74,7 +74,7 @@ export class EmittenProtected<T extends EmittenMap> {
this.#every(this.#singleLibrary);
}

#every = (library: EmittenLibrary<T>) => {
readonly #every = (library: EmittenLibrary<T>) => {
library.forEach((collection, eventName) => {
collection.forEach((listener) => {
this.off(eventName, listener);
Expand Down

0 comments on commit 55f0b2c

Please sign in to comment.