{"id":198790,"date":"2020-11-12T21:02:32","date_gmt":"2020-11-12T13:02:32","guid":{"rendered":"http:\/\/4563.org\/?p=198790"},"modified":"2020-11-12T21:02:32","modified_gmt":"2020-11-12T13:02:32","slug":"%e8%af%b7%e6%b1%82%e5%a4%a7%e7%a5%9e%ef%bc%81%e5%89%8d%e7%ab%af%e6%b1%82%e6%94%af%e6%8f%b4%ef%bc%81%e4%b8%8d%e6%98%af%e7%89%b9%e5%88%ab%e7%90%86%e8%a7%a3-promisea%e8%a7%84%e8%8c%83%e9%87%8c%e9%9d%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=198790","title":{"rendered":"\u8bf7\u6c42\u5927\u795e\uff01\u524d\u7aef\u6c42\u652f\u63f4\uff01\u4e0d\u662f\u7279\u522b\u7406\u89e3 PromiseA+\u89c4\u8303\u91cc\u9762\u7684\u7279\u522b\u6761\u4f8b"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u6c42\u5927\u795e\uff01\u524d\u7aef\u6c42\u652f\u63f4\uff01\u4e0d\u662f\u7279\u522b\u7406\u89e3 PromiseA+\u89c4\u8303\u91cc\u9762\u7684\u7279\u522b\u6761\u4f8b               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : genal <\/span>  <span><i><\/i> 11<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h3>\u7ffb\u8bd1\u4e2d\u6587\u7684 PromiseA+ https:\/\/juejin.im\/post\/6844904086358212621?utm_source=gold_browser_extension#heading-15<\/h3>\n<h3>\u5176\u4e2d<\/h3>\n<p><code>2.3.2.2 \u5982\u679c\u6216\u5f53 x \u72b6\u6001\u662f fulfilled\uff0cresolve \u5b83\uff0c\u5e76\u4e14\u4f20\u5165\u548c promise1 \u4e00\u6837\u7684\u503c value<\/code><\/p>\n<h4>\u4e3a\u4ec0\u4e48\u8981\u4f20\u5165\u548c promise1 \u4e00\u6837\u7684\u503c value \u8fd9\u662f\u4ec0\u4e48\u610f\u601d<\/h4>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4112428\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : marcong95 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u94fe\u63a5\u597d\u50cf\u9519\u4e71\u4e86\uff0c\u590d\u5236\u6253\u5f00\u4e5f\u627e\u4e0d\u5230\u8ddf promise \u6709\u5173\u7684\u4e1c\u897f<\/p>\n<p>\u6211\u731c\u662f\u6307\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u5df2\u7ecf fulfilled \u7684 promise\uff0c\u4f60\u4e0d\u65ad\u5730 then \u5b83\uff0cpromise \u672c\u8eab\u4e0d\u4f1a\u91cd\u65b0\u6267\u884c\u7684\u610f\u601d                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4112429\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mcfog <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             promisesaplus.com                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4112430\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : genal <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8865\u4e00\u4e0b\u94fe\u63a5 https:\/\/juejin.im\/post\/6844903767654023182                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4112431\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gaoryrt <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u4e0a\u53bb\u662f\u4f20\u5165\u4e0a\u4e00\u4e2a resolved \u7684\u503c\u5462                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4112432\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SoloCompany <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &gt; 2.3 [[Resolve]](promise, x)<br \/>\u53ef\u4ee5\u7406\u89e3\u4e3a js \u7684 let promise1 = new Promise(resolve =&gt; { resolve(x) })<br \/>[[Resolve]] \u5c31\u662f\u6307\u8fd9\u4e2a closure \u5185\u7684 resolve \u65b9\u6cd5<\/p>\n<p>&gt; 2.3.1 \u5982\u679c\u8fd4\u56de\u7684 promise1 \u548c x \u662f\u6307\u5411\u540c\u4e00\u4e2a\u5f15\u7528\uff08\u5faa\u73af\u5f15\u7528\uff09\uff0c\u5219\u629b\u51fa\u9519\u8bef<br \/>\u5bf9\u5e94\u4e0a\u8ff0\u8868\u8ff0, \u5373\u5728 closure \u5185\u6267\u884c resolve(promise1) \u7684\u7ed3\u679c\u662f\u629b\u5f02\u5e38<\/p>\n<p>&gt; 2.3.2.2 \u5982\u679c\u6216\u5f53 x \u72b6\u6001\u662f fulfilled\uff0cresolve \u5b83\uff0c\u5e76\u4e14\u4f20\u5165\u548c promise1 \u4e00\u6837\u7684\u503c value<br \/>\u5bf9\u5e94\u4e0a\u8ff0\u8868\u8ff0, \u5373\u5728 closure \u5185\u6267\u884c resolve(x) \u7684\u7ed3\u679c\u662f x \u7684\u72b6\u6001\u7ed3\u679c\u503c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4112433\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SoloCompany <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u89c9\u4e0a\u53ef\u80fd\u662f\u673a\u5668\u7ffb\u8bd1\u7684\u6709\u70b9\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4112434\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SoloCompany <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;\u5e76\u4e14\u4f20\u5165\u548c promise1 \u4e00\u6837\u7684\u503c value&#8221; \u4f3c\u4e4e\u662f\u7ffb\u8bd1\u9519\u8bef, \u6b63\u786e\u7684\u5e94\u8be5\u662f &#8220;\u5e76\u4e14\u628a\u4e00\u6837\u7684\u503c\u8d4b\u4e88 promise1 \u7684 value&#8221;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4112435\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : genal <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SoloCompany \u611f\u8c22 \u660e\u767d\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u6c42\u5927\u795e\uff01\u524d\u7aef\u6c42\u652f\u63f4\uff01\u4e0d\u662f\u7279\u522b\u7406\u89e3&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/198790"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198790"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/198790\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198790"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}