我有一個React Native App,當用戶單擊一個按鈕時,我調用一個函數,該函數_openInterstitial返回2個Promise。代碼如下:_openInterstitial = async () => { try { await AdMobInterstitial.requestAdAsync() await AdMobInterstitial.showAdAsync() } catch (error) { console.error(error) } }當我快速點擊按鈕兩次時,它返回此錯誤已經在請求廣告,請等待之前的承諾。我如何履行await先前的承諾?我是否需要將另一個await帶到另一個try..catch街區?還有其他更簡單的方法嗎?
JavaScript中有多個等待對象嗎?
慕村9548890
2021-05-12 14:19:48