Skip to content

Commit 2eba2ab

Browse files
author
Roland Groza
committed
docs: fix examples
1 parent b470495 commit 2eba2ab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ For CDN, you can use [unpkg](https://unpkg.com):
3434
The global namespace for file-selector is `fileSelector`:
3535
```js
3636
const {fromEvent} = fileSelector;
37-
document.addEventListener('drop', evt => {
38-
const files = fromEvent(evt);
37+
document.addEventListener('drop', async evt => {
38+
const files = await fromEvent(evt);
3939
console.log(files);
4040
});
4141
```
@@ -48,8 +48,8 @@ document.addEventListener('drop', evt => {
4848
Convert a `DragEvent` to File objects:
4949
```ts
5050
import {fromEvent} from 'file-selector';
51-
document.addEventListener('drop', evt => {
52-
const files = fromEvent(evt);
51+
document.addEventListener('drop', async evt => {
52+
const files = await fromEvent(evt);
5353
console.log(files);
5454
});
5555
```
@@ -58,8 +58,8 @@ Convert a file input to File objects:
5858
```ts
5959
import {fromEvent} from 'file-selector';
6060
const input = document.getElementById('myInput');
61-
input.addEventListener('change', evt => {
62-
const files = fromEvent(evt);
61+
input.addEventListener('change', async evt => {
62+
const files = await fromEvent(evt);
6363
console.log(files);
6464
});
6565
```
@@ -68,8 +68,8 @@ input.addEventListener('change', evt => {
6868
Convert a `DragEvent` to File objects:
6969
```ts
7070
const {fromEvent} = require('file-selector');
71-
document.addEventListener('drop', evt => {
72-
const files = fromEvent(evt);
71+
document.addEventListener('drop', async evt => {
72+
const files = await fromEvent(evt);
7373
console.log(files);
7474
});
7575
```

0 commit comments

Comments
 (0)