node通过第一个函数是不是空来,来决定成功失败
成功success 传一个函数,失败传一个函数的
根据 success error来规定成功和失败的



这个函数要返回promise对象,因为它返回promise对象所以它才可以then




通过reslove传递的,promise链
平级的


前面有错误处理,认为已经被处理了,下面这样写不会被处理

前面没搞定就交给后面来处理



这里没说搞不定就认为你搞定了

兜底

调用逻辑搞清楚promise就很好用的


类型不同

node通过第一个函数是不是空来,来决定成功失败
成功success 传一个函数,失败传一个函数的
根据 success error来规定成功和失败的
这个函数要返回promise对象,因为它返回promise对象所以它才可以then
通过reslove传递的,promise链
平级的
前面有错误处理,认为已经被处理了,下面这样写不会被处理
兜底
调用逻辑搞清楚promise就很好用的
类型不同
本文标题:promise2
本文链接:https://www.haomeiwen.com/subject/ryariftx.html
网友评论