{"id":3082,"date":"2013-12-17T13:37:47","date_gmt":"2013-12-17T19:37:47","guid":{"rendered":"http:\/\/bililite.com\/blog\/?p=3082"},"modified":"2013-12-17T13:37:47","modified_gmt":"2013-12-17T19:37:47","slug":"promises-api","status":"publish","type":"post","link":"https:\/\/bililite.com\/blog\/2013\/12\/17\/promises-api\/","title":{"rendered":"Promises API"},"content":{"rendered":"<p>Just in time for <a href=\"http:\/\/bililite.com\/blog\/2013\/12\/16\/thinking-about-synchonicity\/\" title=\"Thinking about synchonicity\">me to start thinking<\/a> about <a href=\"http:\/\/promises-aplus.github.io\/promises-spec\/\">Javascript Promises<\/a>, comes along an <a href=\"http:\/\/www.html5rocks.com\/en\/tutorials\/es6\/promises\/#toc-api\">official API<\/a>, along with a <a href=\"https:\/\/github.com\/jakearchibald\/ES6-Promises\">polyfill<\/a> that basically re-implements rsvp.js with the \"official\" terminology.<\/p>\r\n<p>Now for some experimenting (and rewriting <a href=\"http:\/\/bililite.com\/blog\/2013\/12\/12\/new-jquery-plugin-status\/\" title=\"New jQuery plugin, status\"><code>jquery.status.js<\/code><\/a> to use <em>real<\/em> Promises).<\/p>\r\n<p>It seems from all the discussion that jQuery <code class=\"language-javascript\" >$.Deferred<\/code> are not and will not be real Promises, but they can be <code class=\"language-javascript\" >Promise.cast($.Deferred())<\/code> into one. Note that to use that, you need to <code class=\"language-javascript\" >$.Deferred().resolve()<\/code> on the <em>jQuery<\/em> object, but attach <code class=\"language-javascript\" >Promise.then()<\/code>'s to the <em>Promise<\/em>.<\/p>","protected":false},"excerpt":{"rendered":"Just in time for me to start thinking about Javascript Promises, comes along an official API, along with a polyfill that basically re-implements rsvp.js with the \"official\" terminology. Now for some experimenting (and rewriting jquery.status.js to use real Promises). It seems from all the discussion that jQuery $.Deferred are not and will not be real [&hellip;]","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3082"}],"collection":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/comments?post=3082"}],"version-history":[{"count":3,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3082\/revisions"}],"predecessor-version":[{"id":3085,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3082\/revisions\/3085"}],"wp:attachment":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/media?parent=3082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/categories?post=3082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/tags?post=3082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}