Loads a file at the given path as a Blob, then returns the resulting data or passes it to a success callback function, if provided. On load, this function returns a
Promise
that resolves to a Blob containing the file data.Examples
Syntax
loadBlob(path, [successCallback], [errorCallback])
Parameters
path
String|Request: The path or Request object pointing to the file you want to load.
successCallback
Function: Optional. A function to be called if the file successfully loads, receiving the resulting Blob as its only argument.
errorCallback
Function: Optional. A function to be called if an error occurs during loading; receives the error object as its only argument.
Returns
Promise<Blob>: A promise that resolves with the loaded Blob.
Notice any errors or typos? Please let us know. Please feel free to edit src/io/files.js and open a pull request!