Open coucoseth opened 1 year ago
await
syntax on that Promise.await
syntax, you should be within an async
block.(async () => {
try {
const url = await QRCode.toDataURL(dataForQRCode);
// other piece of code
} catch (e) {
console.error(e);
}
})();
The
other piece of code
gets executed before the callback ofQRCode
. How can i make sure it executes only after the qrcode url is returned