Temp.js
export default class Temp {
async addImageProcess(src){
let img = new Image();
img.src = src;
return img.onload = await function(){
return this.height;
}
}
}
anotherfile.js
import Temp from '../../classes/Temp'
let tmp = new Temp()
imageUrl ="https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png"
let image = tmp.addImageProcess(imageUrl);
console.log(image)
Above is my code. I have a image url and tried to get image's properties using async await but it's not working, don't understand what I missed.
question from:https://stackoverflow.com/questions/46399223/async-await-in-image-loading