PromiseUtils.jsm 编辑
The PromiseUtils.jsm
JavaScript code module offers some useful functions related to DOM Promise. To use it, you first need to import the code module into your JavaScript scope:
Components.utils.import("resource://gre/modules/PromiseUtils.jsm");
Method overview
Deferred defer(); |
Methods
defer()
Creates a new pending Promise
and provides methods to resolve or reject this Promise
.
This method was previously implemented as Promise.defer(), which is obsolete since Gecko 30. And PromiseUtils.defer
uses DOM Promise instead of Promise.jsm's Promise.
Deferred defer();
Parameters
None.
Return value
A new object, containing the new promise in the promise
property, and the methods to change its state in the resolve
and reject
properties. See the Deferred
documentation for details.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论