Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offAny typings must support no arguments #307

Open
clewisln opened this issue Oct 27, 2023 · 0 comments
Open

offAny typings must support no arguments #307

clewisln opened this issue Oct 27, 2023 · 0 comments

Comments

@clewisln
Copy link

When using TypeScript, it is currently not possible to remove all any listeners using ee.offAny(), becuase the typings require a listener to be passed in:

export declare class EventEmitter2 {
    offAny(listener: ListenerFn): this;
}

ee.offAny() //compile error

This should also include void, so that no arguments may be used:

export declare class EventEmitter2 {
    offAny(listener: ListenerFn | void): this;
}

ee.offAny() //now allowed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant