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

FromEvent Docs: No overload matches this call. #7245

Closed
sumitrawat10 opened this issue Apr 9, 2023 · 4 comments · Fixed by #7246
Closed

FromEvent Docs: No overload matches this call. #7245

sumitrawat10 opened this issue Apr 9, 2023 · 4 comments · Fixed by #7246

Comments

@sumitrawat10
Copy link

Describe the bug

As per the https://rxjs.dev/api/index/function/fromEvent in order to use this operator with capture option we can pass the three arguments to it.
image
But LSP is showing the following error.
image

Expected behavior

As per the documentation.
DOM EventTarget

This is an object with addEventListener and removeEventListener methods.

In the browser, addEventListener accepts - apart from event type string and event handler function arguments - optional third parameter, which is either an object or boolean, both used for additional configuration how and when passed function will be called. When fromEvent is used with event target of that type, you can provide this values as third parameter as well.

Reproduction code

Open the following example in Docs using StackBlitz "Use addEventListener with capture option" (https://rxjs.dev/api/index/function/fromEvent)

Reproduction URL

No response

Version

~7.5.0

Environment

No response

Additional context

No response

@demensky
Copy link
Contributor

demensky commented Apr 9, 2023

The problem is not in EventTarget but in the last argument.

Example

@sumitrawat10
Copy link
Author

@demensky in the documentation it says that third argument is either or boolean or an object. If it's changed now ... Should I make ammendment in the docs and send a PR ?

@demensky
Copy link
Contributor

demensky commented Apr 9, 2023

@sumitrawat10
I can't find it in the official documentation. Maybe you are confused with the native method addEventListener in which it is once possible to pass boolean?

@sumitrawat10
Copy link
Author

Screenshot_20230409-232958.jpg

In line 3.

Though at the top it says 'Use addEventListener with capture option'.

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

Successfully merging a pull request may close this issue.

2 participants