Tip: instead of awaiting and immediately returning createImageBitmap you can just return it directly without awaiting. Because you're not doing anything with the image inside getImageFromBlob.
In your case, the value is unwrapped from a Promise then wrapped in a Promise again when returning. You might as well return the initial Promise directly:
1
u/_maximization May 19 '22
Nice video!
Tip: instead of awaiting and immediately returning createImageBitmap you can just return it directly without awaiting. Because you're not doing anything with the image inside getImageFromBlob.
In your case, the value is unwrapped from a Promise then wrapped in a Promise again when returning. You might as well return the initial Promise directly: