本文介绍了这是写的回调更好的办法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
仅仅通过看到我现在已经写了,我可以看到,一个是小很多,所以在的 选项2
是更好的选择,但至于它是清洁,我preFER 选项1
。我真的爱社会的投入这一点。
忘了处理,例如错误,问自己为什么成功回调不会被调用。在另一方面,与承诺然后
-chaining是基于错误回调的可选性,它们传播到一个新的水平 - 当然,它仍然需要有钓到
Just by seeing what I've wrote now, I can see that one is much smaller, so in terms of code golf Option 2
is the better bet, but as far as which is cleaner, I prefer Option 1
. I would really love the community's input on this.
forget about error handling for example, asking themselves why the success callback doesn't get invoked. On the other hand, promises with then
-chaining are based on the optionality of error callbacks, propagating them to the next level - of course it still needs to be catched there.
这篇关于这是写的回调更好的办法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!