@@ -34,8 +34,8 @@ For CDN, you can use [unpkg](https://unpkg.com):
34
34
The global namespace for file-selector is ` fileSelector ` :
35
35
``` js
36
36
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);
39
39
console .log (files);
40
40
});
41
41
```
@@ -48,8 +48,8 @@ document.addEventListener('drop', evt => {
48
48
Convert a ` DragEvent ` to File objects:
49
49
``` ts
50
50
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 );
53
53
console .log (files );
54
54
});
55
55
```
@@ -58,8 +58,8 @@ Convert a file input to File objects:
58
58
``` ts
59
59
import {fromEvent } from ' file-selector' ;
60
60
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 );
63
63
console .log (files );
64
64
});
65
65
```
@@ -68,8 +68,8 @@ input.addEventListener('change', evt => {
68
68
Convert a ` DragEvent ` to File objects:
69
69
``` ts
70
70
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 );
73
73
console .log (files );
74
74
});
75
75
```
0 commit comments