Skip to content

Make isListening immutable #45

@aleclarson

Description

@aleclarson

I'm considering making isListening readonly. Right now, you can set it to false to temporarily remove the listener from its associated event, and set it to true to receive events again. Currently, doing that will make the listener lose its place in the call order (assuming #43 gets fixed).

Instead, there could be a disable method for disabling the listener without losing its place, and an enable method for allowing events to be handled again. Also, a destroy method would be added for removing the listener from its event forever; which would be used for cancelling one-time listeners and automatically clearing out dereferenced listeners.

I'm curious what anyone else thinks of this change. Would the breaking change be worth it? I'm also open to suggestions on the naming of the proposed methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions