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

Incorrect @deprecated for fromEvent overloads #7401

Closed
jefbarn opened this issue Dec 8, 2023 · 3 comments
Closed

Incorrect @deprecated for fromEvent overloads #7401

jefbarn opened this issue Dec 8, 2023 · 3 comments
Labels
8.x Issues and PRs for version 8.x bug Confirmed bug

Comments

@jefbarn
Copy link

jefbarn commented Dec 8, 2023

Describe the bug

I think this @deprecated note is incorrect. Without the generic typescript can't infer the type.

/** @deprecated Do not specify explicit type parameters. Signatures with type parameters that cannot be inferred will be removed in v8. */
export function fromEvent<T>(target: NodeStyleEventEmitter | ArrayLike<NodeStyleEventEmitter>, eventName: string): Observable<T>;

Same for:

/** @deprecated Do not specify explicit type parameters. Signatures with type parameters that cannot be inferred will be removed in v8. */
export declare function fromEvent<T>(target: NodeCompatibleEventEmitter | ArrayLike<NodeCompatibleEventEmitter>, eventName: string): Observable<T>;

Also should probably ADD @deprecated warnings for the overloads with resultSelector.

Expected behavior

It should be like

export declare function fromEvent<T>(target: HasEventTargetAddRemove<T> | ArrayLike<HasEventTargetAddRemove<T>>, eventName: string): Observable<T>;

which is similar generic signature but not deprecated ¯_(ツ)_/¯

Reproduction code

No response

Reproduction URL

No response

Version

7.8.1

Environment

No response

Additional context

No response

@benlesh
Copy link
Member

benlesh commented Dec 11, 2023

Hmm... that is weird. Thank you for pointing that out.

@benlesh benlesh added bug Confirmed bug 8.x Issues and PRs for version 8.x labels Dec 11, 2023
@benlesh
Copy link
Member

benlesh commented Dec 19, 2023

Resolved with #7406

@benlesh benlesh closed this as completed Dec 19, 2023
@vabatta
Copy link

vabatta commented Nov 10, 2024

On 7.8.1 I still get the deprecated when using it on nodejs event emitter, is this correct? @benlesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Issues and PRs for version 8.x bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants