Answers for "error path not found"

0

error path not found

preloadImg(datauri) {
  const img = new Image();
  
  return new Promise((resolve) => {
    img.onload = (event) => {
      const imgElement = event.path ? event.path[0] : event.target;
      resolve(imgElement);
    };
  
    img.src = datauri;
  });
}
Posted by: Guest on July-05-2021

Browse Popular Code Answers by Language