I would like to resolve a promise (the code is below) and assign the result to the qrCode variable.
const qrCode: string = await ... ?; // some async method here...?
QRScanner.prepare((err: QRScannerError, status: QRScannerStatus) => {
QRScanner.scan((err: QRScannerError, value: string) => {
Promise.resolve(value); // return value to qrCode variable...
}
});
}
});
How can i modify that code to get from promise a value into a qrCode variable?