Skip to content

resize event listener not cleaned up #15

@Kinbaum

Description

@Kinbaum

@vaneenige I'm using the cobe library to render a globe on the screen. That library is built on top of phenomenon. What I've noticed is that the resize event listener is never removed when the destroy method is called.

When I scroll my globe out of view I remove it from the DOM as it's wasted resources when it's offscreen.
Looking at the dev tools though, I see multiple addEventListeners for resize as the component mounts / unmounts

Screenshot 2023-11-10 at 1 37 24 PM

Here is a PR #16 with the proposed change

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