Skip to content

Commit 14e86c0

Browse files
committed
Document new custom events
1 parent 6e8ae1e commit 14e86c0

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

README.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,12 @@ remote-input[loading] .loading-icon { display: inline; }
4545

4646
### Events
4747

48-
```js
49-
const remoteInput = document.querySelector('remote-input')
50-
51-
// Network request lifecycle events.
52-
remoteInput.addEventListener('loadstart', function(event) {
53-
console.log('Network request started', event)
54-
})
55-
remoteInput.addEventListener('loadend', function(event) {
56-
console.log('Network request complete', event)
57-
})
58-
remoteInput.addEventListener('load', function(event) {
59-
console.log('Network request succeeded', event)
60-
})
61-
remoteInput.addEventListener('error', function(event) {
62-
console.log('Network request failed', event)
63-
})
64-
```
48+
- `loadstart` - The server fetch has started.
49+
- `load` - The network request completed successfully.
50+
- `error` - The network request failed.
51+
- `loadend` - The network request has completed.
52+
- `remote-input-success` – Received a successful response (status code 200-299). Bubbles.
53+
- `remote-input-error` – Received a not successful response. Bubbles.
6554

6655
## Browser support
6756

0 commit comments

Comments
 (0)