嗨,貝寶上有錯誤反應原生。我從 paypal-react-native 的檔案中獲得了此代碼。該代碼由于某種原因無法正常作業這是代碼
const {
nonce,
payerId,
email,
firstName,
lastName,
phone
} = await requestOneTimePayment(
token,
{
amount: '5',
currency: 'GBP',
shippingAddressRequired: false,
userAction: 'commit',
intent: 'authorize',
}
);
uj5u.com熱心網友回復:
await 是一個承諾,您將回傳一個值,并且您的其余代碼在完成之前不會運行。
它只能在異步函式中使用。
async function asyncCall() {
console.log('calling');
const result = await resolveAfter2Seconds();
console.log(result);
// expected output: "resolved"
}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/406971.html
標籤:
上一篇:原生函式是什么意思?
