add instrumentation

This commit is contained in:
Matt Walsh 2025-05-24 09:22:23 -05:00
commit 5567fe37a6
No known key found for this signature in database
2 changed files with 41 additions and 30 deletions

View file

@ -28,7 +28,15 @@ const preloadImg = (src) => {
return true;
};
const loadImgElement = (url) => new Promise((resolve, reject) => {
const image = new Image();
image.onload = () => resolve(image);
image.onerror = reject;
image.src = url;
});
export {
loadImg,
preloadImg,
loadImgElement,
};