mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-11-28 18:28:04 -08:00
11 lines
406 B
JavaScript
11 lines
406 B
JavaScript
// both fetch steps combined to allow for other image processing work to be done in parallel efficiently
|
|
const fetchImageBlob = async (url) => {
|
|
const response = await fetch(url);
|
|
// test response
|
|
if (!response.ok) throw new Error(`Unable to fetch radar error ${response.status} ${response.statusText} from ${response.url}`);
|
|
// get the blob
|
|
return response.blob();
|
|
};
|
|
|
|
export default fetchImageBlob;
|