首页 > 其他 > 详细

Promise()

时间:2017-09-09 09:11:38      阅读:243      评论:0      收藏:0      [点我收藏+]

Promise()

  The constructor is primarily used to wrap functions that do not already support promises.

  技术分享

executor

  A function that is passed with the arguments resolve and reject. The executor function is executed immediately by the Promise implementation, passing resolve and reject functions (the executor is called before the Promiseconstructor even returns the created object). 

  红字部分:executor在new Promise()返回前就被执行。

  

Promise is in one of these states:

  • pending: initial state, neither fulfilled nor rejected.
  • fulfilled: meaning that the operation completed successfully.
  • rejected: meaning that the operation failed.

参考:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

Promise()

原文:http://www.cnblogs.com/tekkaman/p/7496938.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!