{"id":745,"date":"2019-08-26T01:54:41","date_gmt":"2019-08-26T01:54:41","guid":{"rendered":"http:\/\/www.projectimmerse.com\/blog\/?p=745"},"modified":"2020-06-15T11:31:58","modified_gmt":"2020-06-15T11:31:58","slug":"using-the-promise-object-with-javascript","status":"publish","type":"post","link":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/","title":{"rendered":"Using the Promise Object with Javascript"},"content":{"rendered":"\r\n<p>I haven&#8217;t had to use the Promise function constructor much, I think maybe I&#8217;ve used it a handful of times. I don&#8217;t know if this is a bad thing. To be honest, the concept of promises is still a bit fuzzy to me. I&#8217;d like to build more applications utilizing this construct but I haven&#8217;t had to write any programs that run too many asynchronous operations. Or, the need for it wasn&#8217;t necessary and I got away with writing a bunch of function callbacks. But that&#8217;s what Promises were made for &#8211; to eliminate what developers describe as &#8220;callback hell&#8221; &#8211; basically what you get is a chain of nested callbacks which makes for &#8220;unnecessary inefficient bloat&#8221;. Yeah that&#8217;s exactly what I called it.<\/p>\r\n\r\n<!--more-->\r\n\r\n<p>Ok so this is a continuation of the Advanced Javascript series from <a href=\"https:\/\/www.youtube.com\/watch?v=s6SH72uAn3Q&#038;list=PL7pEw9n3GkoW5bYOhVAtmJlak3ZK7SaDf\" title=\"javaScript promises explained tutorial\">TechSith<\/a> So credit to TechSith for the examples provided on this post.<\/p>\r\n\r\n<p>To simplify the idea of promises in Javascript, we can think of a sequential scenario in which one task needs to finish before starting a new one. I was going to come up with my own example but the &#8220;Clean Room&#8221; example described in the video makes it super simple to understand so let&#8217;s go with that.<\/p>\r\n\r\n<p>Since we are using the &#8216;new&#8217; keyword in constructing an object, the &#8216;new Promise&#8217; constructor will return an object. Our initial variable declaration of &#8216;promiseToCleanTheRoom&#8217; is like setting up or configuring the conditions of our promise. That&#8217;s the way I see it &#8211; makes it easy to understand. So you try coming up with your analogy, I find that this helps.<\/p>\r\n\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\nlet promiseToCleanTheRoom = new Promise(function(resolve, reject) {\r\n\r\n        \/\/ clean the room\r\n\r\n        let isClean = true;\r\n\r\n        if (isClean) {\r\n                resolve('Clean');\r\n        } else {\r\n                reject('not Clean');\r\n        }\r\n\r\n});\r\n\r\npromiseToCleanTheRoom.then(function(fromResolve) {\r\n\r\n        \/\/ Outputs: the room is Clean\r\n        console.log('the room is ' + fromResolve);\r\n\r\n}).catch(function(fromReject) {\r\n\r\n        \/\/ Outputs: the room is not Clean\r\n        console.log('the room is ' + fromReject);\r\n\r\n});   \r\n\r\n<\/pre>\r\n\r\n<p>So it&#8217;s only until we use start using &#8220;promiseToCleanTheRoom.then()&#8230;&#8221; when we actually start seeing the Promise object shine. Instead of nesting callbacks, we instead use the then() method to chain our callbacks which makes for much cleaner code. Again, the key thing to note is that we first set things up using the new Promise() function constructor, which takes in an anonymous function as its argument.<\/p>\r\n\r\n<p>Alright, we got our feet wet with a super simple example. I think we&#8217;re ready to dive into something a bit more complex. In our next example, were going to use the same sequential scenario but this time the steps are going to be the following:<\/p>\r\n\r\n<p>\r\n* Clean Room<br>\r\n* Remove Garbage<br>\r\n* Win Ice Cream<br>\r\n<\/p>\r\n\r\n<p>So basically, we start with cleaning the room, then removing the garbage, then as a reward we get some ice cream. It&#8217;s important to keep in mind that we can&#8217;t skip to our next task before finishing the first task. There is a way to actually get around this &#8211; but for this example were going to do things sequentially.<\/p>\r\n\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n\/\/ a bit more complex example\r\n\/\/ need to finish a task\r\n\/\/ before starting a new task\r\n\r\n\/\/ Clean room example\r\n\r\nlet cleanRoom = function() {\r\n        return new Promise(function(resolve, reject) {\r\n                resolve('Cleaned The Room');\r\n        });\r\n};\r\n\r\nlet removeGarbage = function(message) {\r\n\r\n        return new Promise(function(resolve, reject) {\r\n                resolve(message + ' Remove Garbage');\r\n        });\r\n};\r\n\r\nlet winIceCream = function(message) {\r\n\r\n        return new Promise(function(resolve, reject) {\r\n                resolve(message + ' won Ice cream');\r\n        });\r\n\r\n};\r\n\r\ncleanRoom().then(function(result) {\r\n\r\n        return removeGarbage(result);\r\n\r\n}).then(function(result) {\r\n\r\n        return winIceCream(result);\r\n\r\n}).then(function(result) {\r\n\r\n        console.log('finished ' + result);\r\n\r\n});\r\n\r\n<\/pre>\r\n\r\n<p>Right I know, there&#8217;s a lot going on here. But after observing the code myself, this is a much cleaner approach than nesting callbacks.<\/p>\r\n\r\n<h2>So let&#8217;s break it down<\/h2>\r\n<p>First, we declare our functions and store them in separate task related variables. In this case &#8211; we have:<\/p>\r\n\r\n<p>\r\n* cleanRoom<br>\r\n* removeGarbage<br>\r\n* winIceCream<br>\r\n<\/p>\r\n\r\n<h2>The Set Up<\/h2>\r\n<p>We set up our logic and related parameters first. Each variable is assigned a function which then returns a new Promise object. That&#8217;s the set up.<\/p>\r\n\r\n<h2>Invoking our functions<\/h2>\r\n<p>Once our variables are all set up we can then invoke each of them and chain each one using the then() method.<\/p>\r\n\r\n<h2>The all() and race() methods<\/h2>\r\n<p>Two useful methods when when we want a bit more control with our returned Promise. Here&#8217;s how these methods are used.<\/p>\r\n\r\n<p>Using <strong>all()<\/strong>, each function are all run at the same time-<\/p>\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\nPromise.all(&#x5B;cleanRoom(), removeGarbage(), winIceCream()]).then(function() {\r\n        console.log('all finished');\r\n});\r\n\r\n<\/pre> \r\n\r\n<p>Using <strong>race()<\/strong>, we are expecting that at least one operation or function has at least finished-<\/p>\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\nPromise.race(&#x5B;cleanRoom(), removeGarbage(), winIceCream()]).then(function() {\r\n        console.log('one of them has finished');\r\n});\r\n\r\n<\/pre>\r\n\r\n<p>With both the all() and race() methods we directly call the &#8220;Promise&#8221; object and pass our functions in an array object.<\/p>\r\n\r\n<p>Hope this made sense &#8211; I think this is one of the more not so easy to understand concepts in Javascript. One way to get really good at using Promises is to use it in a real web application. Next time you find yourself nesting your callbacks, use a Promise instead &#8211; even though it&#8217;s only a few callbacks.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>I haven&#8217;t had to use the Promise function constructor much, I think maybe I&#8217;ve used it a handful of times. I don&#8217;t know if this is a bad thing. To be honest, the concept of promises is still a bit fuzzy to me. I&#8217;d like to build more applications utilizing this construct but I haven&#8217;t &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using the Promise Object with Javascript&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1101,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-745","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using the Promise Object with Javascript - Project Immerse<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the Promise Object with Javascript - Project Immerse\" \/>\n<meta property=\"og:description\" content=\"I haven&#8217;t had to use the Promise function constructor much, I think maybe I&#8217;ve used it a handful of times. I don&#8217;t know if this is a bad thing. To be honest, the concept of promises is still a bit fuzzy to me. I&#8217;d like to build more applications utilizing this construct but I haven&#8217;t &hellip; Continue reading &quot;Using the Promise Object with Javascript&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Project Immerse\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-26T01:54:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-15T11:31:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/08\/using-the-promise-object-with-javascript-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"629\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"projectimmerse\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"projectimmerse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/\"},\"author\":{\"name\":\"projectimmerse\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#\\\/schema\\\/person\\\/c53f2864be524ee6fa08a7e4800dd1e5\"},\"headline\":\"Using the Promise Object with Javascript\",\"datePublished\":\"2019-08-26T01:54:41+00:00\",\"dateModified\":\"2020-06-15T11:31:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/\"},\"wordCount\":873,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/using-the-promise-object-with-javascript-1.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/\",\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/\",\"name\":\"Using the Promise Object with Javascript - Project Immerse\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/using-the-promise-object-with-javascript-1.png\",\"datePublished\":\"2019-08-26T01:54:41+00:00\",\"dateModified\":\"2020-06-15T11:31:58+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#\\\/schema\\\/person\\\/c53f2864be524ee6fa08a7e4800dd1e5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/using-the-promise-object-with-javascript-1.png\",\"contentUrl\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/using-the-promise-object-with-javascript-1.png\",\"width\":750,\"height\":629,\"caption\":\"Using the Promise Object in Javascript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/using-the-promise-object-with-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the Promise Object with Javascript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/\",\"name\":\"Project Immerse\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#\\\/schema\\\/person\\\/c53f2864be524ee6fa08a7e4800dd1e5\",\"name\":\"projectimmerse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d06955033d6227bfdcf30014e457e4334f7deeb73907de49b65ec2484921931?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d06955033d6227bfdcf30014e457e4334f7deeb73907de49b65ec2484921931?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d06955033d6227bfdcf30014e457e4334f7deeb73907de49b65ec2484921931?s=96&d=mm&r=g\",\"caption\":\"projectimmerse\"},\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/author\\\/projectimmerse\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the Promise Object with Javascript - Project Immerse","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Using the Promise Object with Javascript - Project Immerse","og_description":"I haven&#8217;t had to use the Promise function constructor much, I think maybe I&#8217;ve used it a handful of times. I don&#8217;t know if this is a bad thing. To be honest, the concept of promises is still a bit fuzzy to me. I&#8217;d like to build more applications utilizing this construct but I haven&#8217;t &hellip; Continue reading \"Using the Promise Object with Javascript\"","og_url":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/","og_site_name":"Project Immerse","article_published_time":"2019-08-26T01:54:41+00:00","article_modified_time":"2020-06-15T11:31:58+00:00","og_image":[{"width":750,"height":629,"url":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/08\/using-the-promise-object-with-javascript-1.png","type":"image\/png"}],"author":"projectimmerse","twitter_card":"summary_large_image","twitter_misc":{"Written by":"projectimmerse","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#article","isPartOf":{"@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/"},"author":{"name":"projectimmerse","@id":"https:\/\/www.projectimmerse.com\/blog\/#\/schema\/person\/c53f2864be524ee6fa08a7e4800dd1e5"},"headline":"Using the Promise Object with Javascript","datePublished":"2019-08-26T01:54:41+00:00","dateModified":"2020-06-15T11:31:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/"},"wordCount":873,"commentCount":0,"image":{"@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/08\/using-the-promise-object-with-javascript-1.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/","url":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/","name":"Using the Promise Object with Javascript - Project Immerse","isPartOf":{"@id":"https:\/\/www.projectimmerse.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/08\/using-the-promise-object-with-javascript-1.png","datePublished":"2019-08-26T01:54:41+00:00","dateModified":"2020-06-15T11:31:58+00:00","author":{"@id":"https:\/\/www.projectimmerse.com\/blog\/#\/schema\/person\/c53f2864be524ee6fa08a7e4800dd1e5"},"breadcrumb":{"@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#primaryimage","url":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/08\/using-the-promise-object-with-javascript-1.png","contentUrl":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/08\/using-the-promise-object-with-javascript-1.png","width":750,"height":629,"caption":"Using the Promise Object in Javascript"},{"@type":"BreadcrumbList","@id":"https:\/\/www.projectimmerse.com\/blog\/using-the-promise-object-with-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.projectimmerse.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using the Promise Object with Javascript"}]},{"@type":"WebSite","@id":"https:\/\/www.projectimmerse.com\/blog\/#website","url":"https:\/\/www.projectimmerse.com\/blog\/","name":"Project Immerse","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.projectimmerse.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.projectimmerse.com\/blog\/#\/schema\/person\/c53f2864be524ee6fa08a7e4800dd1e5","name":"projectimmerse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4d06955033d6227bfdcf30014e457e4334f7deeb73907de49b65ec2484921931?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4d06955033d6227bfdcf30014e457e4334f7deeb73907de49b65ec2484921931?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4d06955033d6227bfdcf30014e457e4334f7deeb73907de49b65ec2484921931?s=96&d=mm&r=g","caption":"projectimmerse"},"url":"https:\/\/www.projectimmerse.com\/blog\/author\/projectimmerse\/"}]}},"_links":{"self":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts\/745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/comments?post=745"}],"version-history":[{"count":16,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts\/745\/revisions"}],"predecessor-version":[{"id":763,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts\/745\/revisions\/763"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/media\/1101"}],"wp:attachment":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/media?parent=745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/categories?post=745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/tags?post=745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}