Skip to content

Commit

Permalink
Rename EventTarget#on() to EventTarget#when()
Browse files Browse the repository at this point in the history
  • Loading branch information
domfarolino committed Jul 22, 2024
1 parent f954c91 commit fdb2d9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ Each {{Observable}} has a <dfn for=Observable>subscribe callback</dfn>, which is
Note: The "union" of these types is to support both {{Observable}}s created by JavaScript (that are
always constructed with a {{SubscribeCallback}}), and natively-constructed {{Observable}} objects
(whose [=Observable/subscribe callback=] could be an arbitrary set of native steps, not a JavaScript
callback). The return value of {{EventTarget/on()}} is an example of the latter.
callback). The return value of {{EventTarget/when()}} is an example of the latter.

<div algorithm>
The <dfn for=Observable constructor lt="Observable(callback)"><code>new
Expand Down Expand Up @@ -1492,12 +1492,12 @@ dictionary ObservableEventListenerOptions {
};

partial interface EventTarget {
Observable on(DOMString type, optional ObservableEventListenerOptions options = {});
Observable when(DOMString type, optional ObservableEventListenerOptions options = {});
};
</pre>

<div algorithm>
The <dfn for=EventTarget method><code>on(|type|, |options|)</code></dfn> method steps are:
The <dfn for=EventTarget method><code>when(|type|, |options|)</code></dfn> method steps are:

1. If [=this=]'s [=relevant global object=] is a {{Window}} object, and its [=associated
Document=] is not [=Document/fully active=], then return.
Expand Down Expand Up @@ -1541,7 +1541,7 @@ partial interface EventTarget {
:: null

Note: The {{AbortSignal}} for event listeners [=add an event listener|added=] by
{{EventTarget/on()}} is managed by the {{Observable}} itself. See
{{EventTarget/when()}} is managed by the {{Observable}} itself. See
{{Observable/subscribe()}} and {{SubscribeOptions}}.

1. Return |observable|.
Expand Down

0 comments on commit fdb2d9d

Please sign in to comment.