Optional
props: TLoadImagePropsconst loaderWithoutCache = loadImage('/image.jpg');
loaderWithoutCache.then((img) => console.log(img)).catch(() => {});
const loaderWithCache = loadImage('/image.jpg', {
crossOrigin: 'anonymous',
useCache: true,
});
loaderWithCache.then((img) => console.log(img)).catch(() => {});
Loads an image from a given source, either a URL or an HTMLImageElement. Supports caching and handling cross-origin requests.