<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rishi Dadheech</title>
    <description>The latest articles on DEV Community by Rishi Dadheech (@rishidadheech).</description>
    <link>https://dev.to/rishidadheech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F205528%2F76335890-6742-4554-ab9e-e6c9c392605b.png</url>
      <title>DEV Community: Rishi Dadheech</title>
      <link>https://dev.to/rishidadheech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rishidadheech"/>
    <language>en</language>
    <item>
      <title>JavaScript Promises</title>
      <dc:creator>Rishi Dadheech</dc:creator>
      <pubDate>Tue, 29 Dec 2020 18:20:32 +0000</pubDate>
      <link>https://dev.to/rishidadheech/javascript-promises-414j</link>
      <guid>https://dev.to/rishidadheech/javascript-promises-414j</guid>
      <description>&lt;p&gt;It's a quick guide to write a function that returns promise and how to consume it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How to write a function that returns promise.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XNtQwaDX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cnb5wwrbemhw1yhucfu9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XNtQwaDX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cnb5wwrbemhw1yhucfu9.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now there are two ways to consume the returned promise.&lt;br&gt;
  A. using then-catch&lt;br&gt;
  B. using async-await&lt;/p&gt;

&lt;p&gt;A. using then-catch&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T64SJMUi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gef5b8caer6a747550kt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T64SJMUi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gef5b8caer6a747550kt.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;B. using async-await&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H3iSCsuS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gr87zccgrnc3ur360fws.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H3iSCsuS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gr87zccgrnc3ur360fws.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
