diff --git a/src/hooks/useRoomMembers.ts b/src/hooks/useRoomMembers.ts index 71a3c46a86..e25436045e 100644 --- a/src/hooks/useRoomMembers.ts +++ b/src/hooks/useRoomMembers.ts @@ -21,7 +21,7 @@ import {RoomMember} from "matrix-js-sdk/src/models/room-member"; import {useEventEmitter} from "./useEventEmitter"; import {throttle} from "lodash"; -// Hook to simplify listening to Matrix Room members +// Hook to simplify watching Matrix Room joined members export const useRoomMembers = (room: Room, throttleWait = 250) => { const [members, setMembers] = useState(room.getJoinedMembers()); useEventEmitter(room.currentState, "RoomState.members", throttle(() => { @@ -30,6 +30,7 @@ export const useRoomMembers = (room: Room, throttleWait = 250) => { return members; }; +// Hook to simplify watching Matrix Room joined member count export const useRoomMemberCount = (room: Room, throttleWait = 250) => { const [count, setCount] = useState(room.getJoinedMemberCount()); useEventEmitter(room.currentState, "RoomState.members", throttle(() => {