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

Fix leaking of GroupStore listeners in RoomList #1664

Merged
merged 4 commits into from
Jan 2, 2018

Conversation

lukebarnard1
Copy link
Contributor

@lukebarnard1 lukebarnard1 commented Dec 15, 2017

Built on #1647

@lukebarnard1 lukebarnard1 changed the title Luke/fix room list group store leak Fix leaking of GroupStore listeners in RoomList Dec 15, 2017
@@ -110,6 +110,12 @@ export default class GroupStore extends EventEmitter {
this._fetchSummary();
this._fetchRooms();
this._fetchMembers();

return {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm a bit surprised that one can return a object like this from registerListener - is this just ignorance, or can we have a comment to explain what API this comes from?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or is this adhoc of our own devising? in which case, it really should be jsdoc'd on the method as the return type

Copy link
Contributor Author

@lukebarnard1 lukebarnard1 Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fairly similar to the flux/utils.Store way of doing things, which returns

{ stop: () => {...} }

I shall leave a comment to explain. (The intention would be to At Some Point move to it actually being a Flux store.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. jsdoc would be good enough, imo: "This method returns an object which callers can use to invoke an unregister hook to..." or whatever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I did both in the end 👍

@ara4n
Copy link
Member

ara4n commented Jan 2, 2018

lgtm modulo comment req

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants