From e186ec7e7969c6451986a6d0b17f0d30106a0520 Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Fri, 17 Jun 2022 14:09:43 +0200 Subject: [PATCH] rename communit callbacks --- packages/status-js/src/client/community/community.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/status-js/src/client/community/community.ts b/packages/status-js/src/client/community/community.ts index cadd3aeb..df9e620f 100644 --- a/packages/status-js/src/client/community/community.ts +++ b/packages/status-js/src/client/community/community.ts @@ -27,7 +27,7 @@ export class Community { public description!: CommunityDescription public chats: Map #members: Map - #descriptionCallbacks: Set<(description: CommunityDescription) => void> + #callbacks: Set<(description: CommunityDescription) => void> constructor(client: Client, publicKey: string) { this.client = client @@ -37,7 +37,7 @@ export class Community { this.chats = new Map() this.#members = new Map() - this.#descriptionCallbacks = new Set() + this.#callbacks = new Set() } public async start() { @@ -221,9 +221,7 @@ export class Community { this.description = description // callback - this.#descriptionCallbacks.forEach(callback => - callback({ ...this.description }) - ) + this.#callbacks.forEach(callback => callback({ ...this.description })) // Chats // handle @@ -234,10 +232,10 @@ export class Community { } public onChange = (callback: (description: CommunityDescription) => void) => { - this.#descriptionCallbacks.add(callback) + this.#callbacks.add(callback) return () => { - this.#descriptionCallbacks.delete(callback) + this.#callbacks.delete(callback) } }