外觀
讀取 Promise 值時,偏好使用 await 而非 then()/catch()/finally()。
await
then()
catch()
finally()
Async/await 語法可以被認為更易讀。
此規則的錯誤程式碼範例
function foo() { hey.then((x) => {}); }
此規則的正確程式碼範例
async function hi() { await thing(); }