<?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: Siddharth Singh Bhadauriya</title>
    <description>The latest articles on DEV Community by Siddharth Singh Bhadauriya (@siddharthssb11).</description>
    <link>https://dev.to/siddharthssb11</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%2F787687%2Ff1a14b9c-a96b-43d8-a356-ea69def02ac4.jpeg</url>
      <title>DEV Community: Siddharth Singh Bhadauriya</title>
      <link>https://dev.to/siddharthssb11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/siddharthssb11"/>
    <language>en</language>
    <item>
      <title>Polling Requests to an API in JavaScript</title>
      <dc:creator>Siddharth Singh Bhadauriya</dc:creator>
      <pubDate>Mon, 17 Jun 2024 20:26:19 +0000</pubDate>
      <link>https://dev.to/siddharthssb11/polling-requests-to-an-api-in-javascript-1g2d</link>
      <guid>https://dev.to/siddharthssb11/polling-requests-to-an-api-in-javascript-1g2d</guid>
      <description>&lt;p&gt;Polling is a technique that repeatedly requests data from a server at regular intervals until a desired response is received or a timeout period elapses. In this article, we will explore how to implement a polling request method in JavaScript to repeatedly hit an API every 5 seconds for up to 300 seconds (5 minutes) or until a successful response is received.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Polling
&lt;/h2&gt;

&lt;p&gt;Polling involves sending periodic requests to an API to check for an update or a specific response. This can be particularly useful in scenarios where you need to wait for a process to complete on the server and then perform actions based on the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Polling Logic
&lt;/h2&gt;

&lt;p&gt;Here is a step-by-step breakdown of the polling logic we will implement:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define the API endpoint and desired success response.&lt;/li&gt;
&lt;li&gt;Set the polling interval (5 seconds) and maximum polling duration (300 seconds).&lt;/li&gt;
&lt;li&gt;Use a loop or a recursive function to repeatedly send requests to the API at the specified interval.&lt;/li&gt;
&lt;li&gt;Check the API response after each request.&lt;/li&gt;
&lt;li&gt;Stop polling if a successful response is received or the maximum polling duration is reached.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Implementing Polling in JavaScript
&lt;/h2&gt;

&lt;p&gt;Let's implement this logic in JavaScript:&lt;/p&gt;

&lt;p&gt;Step 1: Define the API Endpoint and Success Response&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const apiEndpoint = 'https://example.com/api/endpoint'; // Replace with your API endpoint
const successResponse = 'success'; // Define what constitutes a success response

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Set Polling Interval and Maximum Duration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const pollingInterval = 5000; // 5 seconds in milliseconds
const maxPollingDuration = 300000; // 300 seconds (5 minutes) in milliseconds

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3: Implement the Polling Function&lt;/p&gt;

&lt;p&gt;We will create a function pollApi that handles the polling logic. This function will use setTimeout to schedule the next API request if necessary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function pollApi(apiEndpoint, successResponse, pollingInterval, maxPollingDuration) {
    const startTime = Date.now(); // Record the start time

    const makeRequest = async () =&amp;gt; {
        try {
            const response = await fetch(apiEndpoint); // Make request
            const data = await response.json();

            if (data.status === successResponse) {
                console.log('Success response received:', data);
                return; // // Stop polling if success response
            }

            const elapsedTime = Date.now() - startTime;

            if (elapsedTime &amp;lt; maxPollingDuration) {
                setTimeout(makeRequest, pollingInterval); // Schedule next request
            } else {
                console.log('Maximum polling duration reached. Stopping polling.');
            }
        } catch (error) {
            console.error('Error making API request:', error);
            const elapsedTime = Date.now() - startTime;

            if (elapsedTime &amp;lt; maxPollingDuration) {
                setTimeout(makeRequest, pollingInterval); // Schedule next request
            } else {
                console.log('Maximum polling duration reached. Stopping polling.');
            }
        }
    };

    makeRequest(); // Start the first request
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Start Polling&lt;/p&gt;

&lt;p&gt;Call the pollApi function to start polling the API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pollApi(apiEndpoint, successResponse, pollingInterval, maxPollingDuration);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and voila-it works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recursive Approach over Loop
&lt;/h3&gt;

&lt;p&gt;A recursive function is used in the provided solution rather than a loop. The function makeRequest calls itself using setTimeout to create the delay between API requests. This approach leverages JavaScript's asynchronous capabilities to avoid blocking the main thread while waiting for the next request to be made.&lt;/p&gt;

&lt;p&gt;The recursive aspect comes from the makeRequest function calling itself via setTimeout, allowing it to schedule future executions without blocking the main thread. This approach ensures that the next request is only made after the specified interval, maintaining the polling cadence.&lt;/p&gt;

&lt;p&gt;This recursive approach is effective for polling in JavaScript, ensuring that the application remains responsive while waiting for the desired API response or the maximum polling duration to be reached.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we demonstrated how to implement a polling request method in JavaScript to repeatedly hit an API at 5-second intervals for up to 300 seconds or until a successful response is received. Polling can be an effective way to wait for asynchronous processes on the server and react to their outcomes in real time. With this approach, you can ensure your application remains responsive and capable of handling real-world scenarios that require periodic data checks like payment status, ETA status, etc.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>api</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Beginners guide to React.js Batched Updates</title>
      <dc:creator>Siddharth Singh Bhadauriya</dc:creator>
      <pubDate>Sat, 12 Feb 2022 18:04:13 +0000</pubDate>
      <link>https://dev.to/siddharthssb11/beginners-guide-to-reactjs-batched-updates-5c3c</link>
      <guid>https://dev.to/siddharthssb11/beginners-guide-to-reactjs-batched-updates-5c3c</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;A couple of months back when I was learning React and going into deep internet holes to understand every major-minor concept regarding the Why's &amp;amp; How's of them, I stumbled upon React Batched Updates.&lt;br&gt;
I learned how this feature of React acts differently for calling the setState functions synchronously and asynchronously.&lt;/p&gt;

&lt;p&gt;To get better understanding consider this &lt;a href="https://stackblitz.com/edit/react-state-batching-eg" rel="noopener noreferrer"&gt;example&lt;/a&gt;.&lt;br&gt;
It's a simple example to interact with and understand the broader aspect of the difference in the behavior of &lt;strong&gt;Batching&lt;/strong&gt;, or what it used to be recently.&lt;/p&gt;

&lt;p&gt;Now with the onset of React 18, it improves efficiency right out of the box by handling more batching by default, eliminating the need to batch updates manually in application. This post will describe batching, how it used to function, and what has changed. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Some definitions first&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Batching
&lt;/h2&gt;

&lt;p&gt;Batching is when React groups multiple state updates into a single re-render for better performance.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why Such a thing ?? Elaborating a bit..
&lt;/h3&gt;

&lt;p&gt;SetState() can be used to update the states of class components, and hooks (i.e. useState()) can be used to update the states of function components. Parts of the component tree are re-rendered as a result of these changes. A simple solution would be to re-render the component after each use to setState(), however this would be inefficient when numerous calls to setState() are made within a React event handler or synchronous lifecycle method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React implements a batched updating mechanism to reduce the number of component renders. Consequently, multiple state changes will be batched into a single update, which will eventually trigger one re-render of a component.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Again check this &lt;a href="https://stackblitz.com/edit/react-state-batching-eg" rel="noopener noreferrer"&gt;example&lt;/a&gt; for better clarity and understanding.&lt;/p&gt;
&lt;h2&gt;
  
  
  In just Recent-Past..
&lt;/h2&gt;

&lt;p&gt;When React batches updates are done in known ways like lifecycle methods or event handlers, React batches them, but not when they are made in callbacks like SetTimeout or Promises. This means that if you make several calls to update the state, React will re-render the component after each call.&lt;/p&gt;

&lt;p&gt;After using useState or this.setState to update your component's state, elements of the component re-render depending on the update. More importantly, if you have many calls to update the state within a React event handler like onClick, React does the updates in a batch rather than one at a time, minimizing the number of renderings the component performs.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;If two state updates occur inside the same click event, React will always combine them into a single re-render. If you execute the following code, you'll notice that React only renders once for each click, despite the fact that the state is set twice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Does not re-render yet&lt;/span&gt;
    &lt;span class="nf"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Does not re-render yet&lt;/span&gt;
    &lt;span class="c1"&gt;// React will only re-render once at the end (that's batching!)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Click on me !!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;flag&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;yellow&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;purple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is beneficial to performance because it reduces the number of unwanted re-renders. It also prevents your component from presenting "half-finished" states in which only one state variable has been changed, which could lead to issues and bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setback:&lt;/strong&gt; However, React wasn’t consistent about when it batches updates. For example, if you need to fetch data, and then update the state in the handleClick above, then React would not batch the updates, and perform two independent updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We only batched updates during the React event handlers, until React 18. By default, React did not batch updates inside of promises, setTimeout, native event handlers, or any other event.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Present-Coming Days Batching Behavior..
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Starting in React 18 mostly, all updates will be automatically batched, no matter where they originate from.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automatic Batching:&lt;/strong&gt; This means that updates in timeouts, promises, native event handlers, and any other event will batch in the same manner that updates in React events do. Anticipate that this will result in less work being rendered and, as a result, better performance in your apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// React will only re-render once at the end (that's batching!)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;behaves the same as this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// React will only re-render once at the end (that's batching!)&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;behaves the same as this too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/*...*/&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// React will only re-render once at the end (that's batching!)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and also behaves the same as this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// React will only re-render once at the end (that's batching!)&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope this helps. It helped me. A programmer just like you. 🌟&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Crashing gracefully while error handling using Error Boundaries.</title>
      <dc:creator>Siddharth Singh Bhadauriya</dc:creator>
      <pubDate>Sat, 12 Feb 2022 17:48:47 +0000</pubDate>
      <link>https://dev.to/siddharthssb11/crashing-gracefully-while-error-handling-using-error-boundaries-558a</link>
      <guid>https://dev.to/siddharthssb11/crashing-gracefully-while-error-handling-using-error-boundaries-558a</guid>
      <description>&lt;h2&gt;
  
  
  Problem at Hand
&lt;/h2&gt;

&lt;p&gt;Suppose a JavaScript error occurs within a component, it might cause React's internal state to be corrupted, resulting in cryptic errors. I ran into the same situation, just like you and many others too. &lt;br&gt;
During the development of our apps, we will invariably run into unforeseen errors. It's possible that you're attempting to access a deeply nested property on an object that doesn't exist, or that it's out of your control (like a failed HTTP request to a third-party API). &lt;br&gt;
Errors are bound to happen in our applications. When an issue occurs in the app, the component unmounts altogether, leaving the user with a blank HTML page. Users may become perplexed and unsure of what to do next as a result of this.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;As a result, a number of techniques have been created to prevent these problems from interfering with the user and developer experience. The use of &lt;strong&gt;error boundaries&lt;/strong&gt; is one such way in React.&lt;br&gt;
Error Boundaries give an elegant method to deal with these problems!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;What exactly are Error Boundaries? It's not a new component or JavaScript library, contrary to popular belief. It’s more like a strategy for handling errors in React components.&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;br&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Explanation&lt;/li&gt;
&lt;li&gt;Usage&lt;/li&gt;
&lt;li&gt;Comparison with TryCatch&lt;/li&gt;
&lt;li&gt;
Limitations
 
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Installed as one of your project's &lt;code&gt;dependencies&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save react-error-boundary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Explanation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reason to Use:&lt;/strong&gt;&lt;br&gt;
Error boundaries are React components which catch JavaScript errors anywhere in our app, log those errors, and display a fallback UI. It does not break the whole app component tree and only renders the fallback UI whenever an error occurred in a component. &lt;br&gt;
We can use Error Boundaries to give the user visual notification that something went wrong while still allowing them to engage with our programme.&lt;br&gt;
So now they have the option of navigating away or contacting customer service for assistance in resolving their issue! It's a terrific technique to make up for an otherwise bad user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Working Principle&lt;/strong&gt;&lt;br&gt;
Error boundaries catch errors during rendering in component lifecycle methods, and constructors of the whole tree below them. So basically, error boundaries only handle errors in the parts of our code that involve React.&lt;br&gt;
Suppose an error is encountered then what happens is as soon as there is a broken JavaScript part in Rendering or Lifecycle Methods, It tries to find the nearest Error Boundaries Tag and sort the error out with a Fallback-UI.&lt;/p&gt;
&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;The simplest way to use &lt;code&gt;&amp;lt;ErrorBoundary&amp;gt;&lt;/code&gt; is to wrap it around any component that may throw an error. This will handle errors thrown by that component andits descendants too.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ErrorBoundary&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-error-boundary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ErrorFallback&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;resetErrorBoundary&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"alert"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Something went wrong:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;pre&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;pre&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;resetErrorBoundary&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Try again&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ui&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ErrorBoundary&lt;/span&gt;
    &lt;span class="na"&gt;FallbackComponent&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ErrorFallback&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;onReset&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// reset the state of your app so the error doesn't happen again&lt;/span&gt;
      &lt;span class="c1"&gt;//eg. reload the page using window.location.reload()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ComponentThatMayError&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ErrorBoundary&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can react to errors (e.g. for logging) by providing an &lt;code&gt;onError&lt;/code&gt; callback:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ErrorBoundary&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-error-boundary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myErrorHandler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;componentStack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Do something with the error&lt;/span&gt;
  &lt;span class="c1"&gt;// E.g. log to an error logging client here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ui&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ErrorBoundary&lt;/span&gt; &lt;span class="na"&gt;FallbackComponent&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ErrorFallback&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;onError&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myErrorHandler&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ComponentThatMayError&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ErrorBoundary&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Comparison with TryCatch
&lt;/h2&gt;

&lt;p&gt;One question that may cross your mind is why should you learn this new concept when Error Boundaries works like Catch? Well, the answer is Try…catch is used in specific code blocks where you program the functionality of the application.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Try…Catch&lt;/em&gt; deals with &lt;em&gt;imperative code&lt;/em&gt; while &lt;strong&gt;Error Boundaries&lt;/strong&gt; deal with &lt;strong&gt;declarative code&lt;/strong&gt; and as we know that React is declarative in nature, and Error Boundaries help in preserving the declarative nature of React.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Imperative programming is how you do something and declarative programming is what you do.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With error boundary, if there is an error, you can trigger a fallback UI; whereas, with try…catch, you can catch errors in your code and throw/re-throw/handle the error and further display it using a modal bla bla...&lt;/p&gt;

&lt;p&gt;Error Boundaries actually aren’t in direct competition with try...catch statements as Error Boundaries are only designed for intercepting errors that originate from 3 places in a React component: During render phase, In a lifecycle method, In the constructor (Reacty Stuffs).&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;There are certain limitations to Error Boundaries too. &lt;br&gt;
Following are the places where Error Boundaries will not be able to catch an error:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event handlers (e.g., onClick, onChange, etc.).&lt;/li&gt;
&lt;li&gt;Asynchronous code(Example request Animation Frame, setTimeout)&lt;/li&gt;
&lt;li&gt;Server-side rendering (SSR)&lt;/li&gt;
&lt;li&gt;And errors caused by the error boundary itself (rather than its children)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So Error Boundaries don’t really impact how you use try...catch. They’re both needed as a robust strategy for handling errors in React.&lt;/p&gt;




&lt;p&gt;I recently came across this concept and was not able to stop myself falling in love with such &lt;strong&gt;component-based-js-errors-catching&lt;/strong&gt;. &lt;br&gt;
I hope this helps&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Combining two independent git repositories</title>
      <dc:creator>Siddharth Singh Bhadauriya</dc:creator>
      <pubDate>Thu, 10 Feb 2022 22:31:16 +0000</pubDate>
      <link>https://dev.to/siddharthssb11/combining-two-independent-git-repositories-1b5i</link>
      <guid>https://dev.to/siddharthssb11/combining-two-independent-git-repositories-1b5i</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;You might be pondering why anyone would wish to combine two different git repositories into a single repository. Couple of weeks back, I came across a problem. I was working on a &lt;a href="https://reactjs.org/docs/getting-started.html" rel="noopener noreferrer"&gt;React JS&lt;/a&gt; project and for the frontend styling, I went for &lt;a href="https://v4.mui.com/getting-started/installation/" rel="noopener noreferrer"&gt;Material-UI&lt;/a&gt;. &lt;br&gt;
60% of the project was done and then somehow ran into some styling and responsive issue in my project. Now I was ready to go for &lt;a href="https://chakra-ui.com/docs/getting-started" rel="noopener noreferrer"&gt;Chakra-UI&lt;/a&gt; in the same repo itself, but then again it would have messed up my central theme object, ending up only with bunch of cross frameworks error and lots of styling conflicts. &lt;br&gt;
I had a few solutions on my hand, went for creating a new repository but this time the framework was Chakra-UI, so with number of logic and styling changes, I had the desired output. &lt;br&gt;
I was about to rewrite/copy/paste the new code that I had written (in a new git repo) into my first original project repository, when it occurred to me that I could probably merge the two independent repositories on my machine to avoid whole editing fiasco. &lt;/p&gt;
&lt;h3&gt;
  
  
  Generalization
&lt;/h3&gt;

&lt;p&gt;You have repository A with remote location remoteA, and repository B (which may or may not have remote location remoteB). You want to do one of two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep both repositories' commits, but replace the contents of A with the contents of B, and use remoteA as your remote location.&lt;/li&gt;
&lt;li&gt;Use remoteA as the remote location to join the two repositories as though they were two branches that you wanted to merge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case&lt;/strong&gt;: This may also be useful if you're working on project components in one git while working on template files in another git, and then wish to integrate the two.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Things to consider now:&lt;/strong&gt;&lt;br&gt;
Make sure your local and remote repositories are up to date with all the modifications you'll require before you begin. To unite the two master branches, the following procedures apply the general idea of altering the remote origin and renaming the local master branch of one of the repos.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Check out `git subtree`/`git submodule`. 
Before going through the steps below. 
This post is just a walkthrough of how 
I reached the solution of the stated problem.  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Go on this Road
&lt;/h3&gt;

&lt;p&gt;Change the remote origin of B to that of A:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd someDirectory/somePath/leading/to/B
$ git remote rm origin
$ git remote add origin &amp;lt;url_to_remoteA&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rename the local master branch of B:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git checkout master
$ git branch -m master-new-stay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pull all the code of A from remoteA into your local B repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git fetch
$ git checkout master
$ git pull origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;The master branch of A is now the &lt;strong&gt;master&lt;/strong&gt; branch of B. &lt;strong&gt;master-new-stay&lt;/strong&gt; is the old master branch of B.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now delete all the things that you pulled from remoteA.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git rm -rf *
$ git commit -m "Delete all the things."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, merge &lt;em&gt;master-new-stay&lt;/em&gt; into &lt;em&gt;master&lt;/em&gt; and alongside add the &lt;code&gt;--allow-unrelated-histories&lt;/code&gt; flag too.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git merge master-new-stay --allow-unrelated-histories
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;git log&lt;/code&gt; should show all the commits from A, the delete commit, the merge commit, and finally all the commits from B.&lt;/p&gt;

&lt;p&gt;Push everything to remoteA&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Voila
&lt;/h4&gt;

&lt;p&gt;Your local copy of B has now become a &lt;strong&gt;consolidate&lt;/strong&gt; repository, containing all of A and B's commits. The remote repository is remoteA. You don't need your local copy of A or the remote repository remoteB any longer.&lt;/p&gt;

&lt;p&gt;I hope this has been helpful.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>javascript</category>
      <category>merging</category>
    </item>
  </channel>
</rss>
