mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
add instrumentation
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user