1.更好的错误处理 同步代码中的异常不论出现在何处都会以rejection的形式向Promise链后端传递。
2.更好的兼容性 你可以始终使用你自己喜欢的Promise实现,而不用担心第三方代码在使用哪个
3.更好的代码阅读体验 所有的代码在水平方向上将处于同一个缩进层级,这将使你阅读代码变得更容易。








1.更好的错误处理 同步代码中的异常不论出现在何处都会以rejection的形式向Promise链后端传递。
2.更好的兼容性 你可以始终使用你自己喜欢的Promise实现,而不用担心第三方代码在使用哪个
3.更好的代码阅读体验 所有的代码在水平方向上将处于同一个缩进层级,这将使你阅读代码变得更容易。
本文标题:Promise用法
本文链接:https://www.haomeiwen.com/subject/fzfjkftx.html
网友评论