<?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: JT Cho</title>
    <description>The latest articles on DEV Community by JT Cho (@taekcho).</description>
    <link>https://dev.to/taekcho</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%2F1308968%2Fb7ab2348-da78-4314-82aa-8f5c484cfd90.png</url>
      <title>DEV Community: JT Cho</title>
      <link>https://dev.to/taekcho</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/taekcho"/>
    <language>en</language>
    <item>
      <title>Redux reducers: not to do</title>
      <dc:creator>JT Cho</dc:creator>
      <pubDate>Wed, 28 Feb 2024 00:43:01 +0000</pubDate>
      <link>https://dev.to/taekcho/redux-reducers-not-to-do-14m1</link>
      <guid>https://dev.to/taekcho/redux-reducers-not-to-do-14m1</guid>
      <description>&lt;p&gt;Reducers must be:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;pure&lt;/strong&gt;: pure reducer does not mutate the state directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;side-effect free&lt;/strong&gt;: reducer does not change a non-local state, nor use an external code. ex) console.log()&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;synchronous&lt;/strong&gt;: reducer does not "await" for asynchronous results. ex) HTTP request&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If &lt;strong&gt;side-effects &amp;amp; async&lt;/strong&gt; tasks are necessary,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use them &lt;strong&gt;inside components&lt;/strong&gt;: via useEffect.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;action creators&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>redux</category>
      <category>webdev</category>
      <category>react</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
