Skip to content

Commit 1c8e935

Browse files
committed
example: move File to script
1 parent 68b8079 commit 1c8e935

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

example/src/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
let eventData = {};
3030
let eventRef = {};
3131
32+
let file = new File(['hello world'], 'filename');
33+
3234
let readyToUpload = false;
3335
3436
function onData(e) {
@@ -204,7 +206,7 @@
204206

205207
<h3>UploadTask:</h3>
206208

207-
<UploadTask path={'myfile.txt'} file={new File(['hello world'], 'filename')} let:task let:snapshot let:downloadURL>
209+
<UploadTask path={'myfile.txt'} {file} let:task let:snapshot let:downloadURL>
208210

209211
Progress {(snapshot.bytesTransferred / snapshot.totalBytes) * 100} <br>
210212
State {snapshot.state}

0 commit comments

Comments
 (0)