minutemailer/react-popup

EventEmitter memory leak

Closed this issue · 3 comments

In componentWillUnmount() event listeners that were placed on the store in componentDidMount() were not removed.

    componentDidMount() {
        Store.on(Constants.SHOW, this.bound.onShow);
        Store.on(Constants.CLOSE, this.bound.onClose);
        Store.on(Constants.REFRESH, this.bound.onRefresh);
    }

    componentWillUnmount() {
        // need to remove Store event listeners
        key.deleteScope('react-popup');
        key.filter = defaultKeyFilter;
    }

Ah, thanks! Will make sure it's added in the next release

I want to help on this. @tbleckert

Merged in master (thanks to @quannt ). Will be published to npm along with the other v1.0.0 stuff asap.