sveltekit-zero-api
sveltekit-zero-api copied to clipboard
[Feature Request] 2.0 - xhr, upload progress tracking
I haven't had a look at the PR for feedback yet, but my projects depend heavily on sveltekit-zero-api so I'll definitely dig into it within the coming weeks.
With that said, any thoughts on supporting xhr/upload progress events?
Example:
let progress = $state(0)
async function onprogress(e) {
if (event.lengthComputable) {
const percentComplete = (event.loaded / event.total) * 100
progress = percentComplete
}
}
async function onsubmit() {
await api.videos.POST({ body, xhr: { upload: { onprogress } })...
}