add instrumentation

This commit is contained in:
Matt Walsh
2025-05-24 09:22:23 -05:00
parent 2dcc33f210
commit 5567fe37a6
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,
};