<?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: wyattGTL</title>
    <description>The latest articles on DEV Community by wyattGTL (@wyattgtl).</description>
    <link>https://dev.to/wyattgtl</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%2F346358%2F1f4b5050-c7b9-41d8-b1db-c387fd09caf9.png</url>
      <title>DEV Community: wyattGTL</title>
      <link>https://dev.to/wyattgtl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wyattgtl"/>
    <language>en</language>
    <item>
      <title>Are reducers split too specific?</title>
      <dc:creator>wyattGTL</dc:creator>
      <pubDate>Tue, 10 Mar 2020 19:08:52 +0000</pubDate>
      <link>https://dev.to/wyattgtl/are-reducers-split-too-specific-4da1</link>
      <guid>https://dev.to/wyattgtl/are-reducers-split-too-specific-4da1</guid>
      <description>&lt;p&gt;I have &lt;code&gt;glossaryReducer&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;This reducer is responsible for fetching the glossary, adding terms to the glossary, and removing terms from the glossary.&lt;/p&gt;

&lt;p&gt;It's state consists of &lt;code&gt;{glossaryData:[], isFetching:false, isAddingTerm:false, isRemovingTerm:false}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Basically, glossaryReducer handles functionality having to do with the glossary.&lt;/p&gt;

&lt;p&gt;Alternatively, I could have three reducers: &lt;code&gt;fetchGlossaryReducer, addTermReducer, removeTermReducer&lt;/code&gt;. Each reducer can have the state &lt;code&gt;{isFetching:false}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Does splitting up reducers this specific make sense? Imaging I am building a medium to large scale application.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
    </item>
    <item>
      <title>Best way to allow other components to change table's focused row?</title>
      <dc:creator>wyattGTL</dc:creator>
      <pubDate>Thu, 05 Mar 2020 16:02:51 +0000</pubDate>
      <link>https://dev.to/wyattgtl/best-way-to-allow-other-components-to-change-table-s-focused-row-2mba</link>
      <guid>https://dev.to/wyattgtl/best-way-to-allow-other-components-to-change-table-s-focused-row-2mba</guid>
      <description>&lt;p&gt;I have &lt;code&gt;displayProjectTable&lt;/code&gt; that gets state from reducer &lt;code&gt;projectData&lt;/code&gt; and populates itself. &lt;/p&gt;

&lt;p&gt;Currently &lt;code&gt;displayProjectTable&lt;/code&gt; has a local state that stores &lt;code&gt;focusedRowID&lt;/code&gt;. My problem is that I want other components to have the ability to modify the &lt;code&gt;focusedRowID&lt;/code&gt; and it's content.&lt;/p&gt;

&lt;p&gt;Some examples:&lt;br&gt;
-A component tells &lt;code&gt;displayProjectTable&lt;/code&gt; to add 1 to &lt;code&gt;focusedRowID&lt;/code&gt; (ie. focus on the next row)&lt;br&gt;
-A component tells &lt;code&gt;displayProjectTable&lt;/code&gt; to set value of row at &lt;code&gt;focusedRowID&lt;/code&gt; to "test". Because &lt;code&gt;displayProjectTable&lt;/code&gt; gets its state from &lt;code&gt;projectData&lt;/code&gt;, that reducer's state will have to be changed at the &lt;code&gt;focusedRowID&lt;/code&gt; index.&lt;/p&gt;

&lt;p&gt;A possible solution is to store &lt;code&gt;focusedRowID&lt;/code&gt; inside of the &lt;code&gt;projectData.js&lt;/code&gt; reducer. However, this seems like a bad solution to me. The &lt;code&gt;projectData&lt;/code&gt; reducer is responsible for fetching, storing, and saving &lt;code&gt;projectData&lt;/code&gt;. Would it really make sense to store a &lt;code&gt;focusedRowID&lt;/code&gt; when &lt;code&gt;projectData&lt;/code&gt; shouldn't even know what a row is?&lt;/p&gt;

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