-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add webservice example in html
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<html> | ||
<head> | ||
<script src="../dist/filelist-utils.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
async function doAll() { | ||
const fileCollection = await FileListUtil.fileCollectionFromWebservice( | ||
'https://zakodium-oss.github.io/analysis-dataset/gcms.json', | ||
); | ||
|
||
for (let i = 0; i < 10; i++) { | ||
console.log(await fileCollection.files[0].text()); | ||
console.log(await fileCollection.files[0].arrayBuffer()); | ||
await delay(5000); | ||
} | ||
} | ||
|
||
function delay(ms) { | ||
return new Promise((resolve) => setTimeout(resolve, ms)); | ||
} | ||
|
||
doAll(); | ||
</script> | ||
FileList | ||
</body> | ||
</html> |