29 字
1 分钟
优雅的处理asnyc await
上代码
const errorCaptured = async (asyncFunc) => { try { const res = await asyncFunc(); return [null, res]; } catch (error) { return [error, null]; }}; 优雅的处理asnyc await
https://nollieleo.github.io/posts/优雅的处理asnyc-await/