Skip to content

Rename _useCapture #91

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

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/content/docs/contributing/api-modelling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,15 @@ We can use [a fixed argument](https://rescript-lang.org/docs/manual/latest/bind-

```ReScript
@send
external addEventListener_useCapture: (
external addEventListenerWithCapture: (
htmlButtonElement,
~type_: eventType,
~callback: eventListener<'event>,
@as(json`true`) _,
) => unit = "addEventListener"
```

<Aside type="caution" title="Improving methods">
Be aware that inherited interfaces duplicate their inherited methods. This
means that improving `addEventListener` in the `EventTarget` interface
requires to update all interfaces that inherit from `EventTarget`.
</Aside>
When naming an overloaded function, we can use the `With` suffix to indicate that it is an overloaded function.

### Decoded variants

Expand Down
2 changes: 1 addition & 1 deletion src/EventAPI/EventTarget.res
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The event listener is appended to target's event listener list and is not append
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
*/
@send
external addEventListener_useCapture: (
external addEventListenerWithCapture: (
T.t,
eventType,
eventListener<'event>,
Expand Down
2 changes: 1 addition & 1 deletion src/Global.res
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ If an AbortSignal is passed for options's signal, then the event listener will b
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
*/
external addEventListener_useCapture: (
external addEventListenerWithCapture: (
eventType,
eventListener<'event>,
@as(json`true`) _,
Expand Down
Loading