Skip to content

Can't use removeEventListener #59

@jamesfzhang

Description

@jamesfzhang

In componentWillMount, I add an event listener to Wallop.

this.wallop = new Wallop(document.querySelector('.Wallop'));
this.wallop.on('change', this.handleWallopChange);

In componentWillUnmount, I want to remove the listener

this.wallop.$selector.removeEventListener('change', this.handleWallopChange);

This doesn't work since Wallop's implementation of on uses an anonymous function. Is it possible to use the callback event instead and perhaps add an off method? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions