Skip to main content

FileUploadService

type FileUploadService<Response = string> = (
file: File,
onProgress: (progress: number) => void
) => Promise<Response>

An async function that can be called with a File and a function to track the progress of the upload.

Review useXMLHttpService for an existing implementation.

This type is meant as an abstraction so you can use any http / socket connection library. An example being useXMLHttpService could be recreated functionality wise with something like axios.