WIP
This commit is contained in:
9
src/board/loaders/loadImage.ts
Normal file
9
src/board/loaders/loadImage.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
const loadImage = (url: string): Promise<HTMLImageElement> => {
|
||||
return new Promise((resolve) => {
|
||||
const img = new Image();
|
||||
img.addEventListener("load", () => resolve(img), { once: true });
|
||||
img.src = url;
|
||||
});
|
||||
};
|
||||
|
||||
export default loadImage;
|
||||
Reference in New Issue
Block a user