Skip to content

Commit

Permalink
Nitpick terminology around events in explainer
Browse files Browse the repository at this point in the history
The callback/listener distinction is not very important, changes really
done to avoid the wording "new event listener", as it's a new event type.

See https://dom.spec.whatwg.org/#concept-event-listener
  • Loading branch information
foolip committed Jan 25, 2018
1 parent c608499 commit 8da1da6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions explainer.adoc
Expand Up @@ -8,7 +8,7 @@ A modern API for asynchronous clipboard access.

2. Basic async methods for reading/writing clipboard data that return a `Promise`.

3. A new event listener to detect clipboard change events.
3. A new `clipboardchange` event to detect clipboard changes.

For a complete description of this API, see the
link:https://w3c.github.io/clipboard-apis/[Clipboard API and events]
Expand Down Expand Up @@ -193,7 +193,7 @@ To catch if the read operation fails, a second function can be passed to the
})
```

=== Event Listener for `clipboardchange` Events
=== The `clipboardchange` Event

This event fires whenever the clipboard contents are changed. If the
clipboard contents are changed outside the browser, then this event
Expand All @@ -202,11 +202,11 @@ fires when the browser regains focus.
Example of detecting clipboard changes:

```javascript
function listener(event) {
function callback(event) {
// Do stuff with navigator.clipboard
}

navigator.clipboard.addEventListener("clipboardchange", listener);
navigator.clipboard.addEventListener("clipboardchange", callback);
```


Expand Down

0 comments on commit 8da1da6

Please sign in to comment.