Skip to content

Commit ba7e2d9

Browse files
authored
Merge pull request #91 from rescript-lang/rename-add-event-listener
Rename _useCapture
2 parents 7c3cb99 + 2fe6c4a commit ba7e2d9

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

docs/content/docs/contributing/api-modelling.mdx

+2-6
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,15 @@ We can use [a fixed argument](https://rescript-lang.org/docs/manual/latest/bind-
4848

4949
```ReScript
5050
@send
51-
external addEventListener_useCapture: (
51+
external addEventListenerWithCapture: (
5252
htmlButtonElement,
5353
~type_: eventType,
5454
~callback: eventListener<'event>,
5555
@as(json`true`) _,
5656
) => unit = "addEventListener"
5757
```
5858

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

6561
### Decoded variants
6662

src/EventAPI/EventTarget.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The event listener is appended to target's event listener list and is not append
5454
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
5555
*/
5656
@send
57-
external addEventListener_useCapture: (
57+
external addEventListenerWithCapture: (
5858
T.t,
5959
eventType,
6060
eventListener<'event>,

src/Global.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ If an AbortSignal is passed for options's signal, then the event listener will b
554554
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
555555
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
556556
*/
557-
external addEventListener_useCapture: (
557+
external addEventListenerWithCapture: (
558558
eventType,
559559
eventListener<'event>,
560560
@as(json`true`) _,

0 commit comments

Comments
 (0)