jQuery是否承诺遵守Promises/A + [英] do jQuery promises conform Promises/A+

查看:94
本文介绍了jQuery是否承诺遵守Promises/A +的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读本文是基于著名的 Domenic Denicola的文章.第一个说:

I have read this article which is based on famous Domenic Denicola's article. The first one says:

jQuery的实现问题(直到1.9版)是 它不遵守规范的第二部分,这 函数应该返回一个新的promise…",即然后"不返回 执行其中一个处理程序时,新的Promise对象( 填充,拒绝或进度处理程序).

The problem with jQuery’s implementation (up until version 1.9) is that it doesn’t respect the second part of the specification, "This function should return a new promise…", that is "then" doesn’t return a new promise object when executing one of the handlers (either the fullfillment, the rejection or the progress handler).

我发现了与该问题相对应的以下错误:

I have found these bugs corresponding to this problem:

  • http://bugs.jquery.com/ticket/14510
  • https://github.com/jquery/jquery/issues/1722

我的问题是:此问题的当前状态是什么?两者均已打开,因此工作仍在进行中.但是,使用jQuery 2,您可以使用.then链接promise.所以:仍然是jQuery.Promises实现坏了吗?自1.9版以来,有什么变化吗?

My question is: what is the current state of this issue? Both are opened, so the work is still in progress. But, using jquery 2, you can chain promises with .then. So: is still jQuery.Promises implementation broken? Did anything change since version 1.9?

推荐答案

更新:从jQuery 3.0开始,答案是. jQuery Promise是Promises/A +兼容的,可以安全使用.

Update: As of jQuery 3.0 the answer is yes. jQuery promises are Promises/A+ compatible and can be safely used.

jQuery承诺当前不遵守Promises/A +规范,因此 有一些问题 ,Domenic的文章仍然有效.

jQuery promises do not currently adhere to the Promises/A+ specification and thus have some issues and Domenic's article is still valid.

表示正在进行中的工作已经完成,jQuery承诺最终将在下一个版本中符合Promises/A + .它仍在进行中此处是相关的提取请求

That said active work is being done and jQuery promises will finally be Promises/A+ compliant in the next version. It's still work in progress here is the relevant pull request and here. The last bit of work on it was two days ago.

激动人心的时刻.

这篇关于jQuery是否承诺遵守Promises/A +的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆