<?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: MD Zahid Hasan</title>
    <description>The latest articles on DEV Community by MD Zahid Hasan (@zahidhasan2806).</description>
    <link>https://dev.to/zahidhasan2806</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%2F821700%2F5060ad09-ae1c-4bcf-8f04-21d3ba6d0e3d.jpeg</url>
      <title>DEV Community: MD Zahid Hasan</title>
      <link>https://dev.to/zahidhasan2806</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zahidhasan2806"/>
    <language>en</language>
    <item>
      <title>Redux Toolkit-A standard way to write redux</title>
      <dc:creator>MD Zahid Hasan</dc:creator>
      <pubDate>Fri, 04 Mar 2022 19:48:32 +0000</pubDate>
      <link>https://dev.to/zahidhasan2806/redux-toolkit-a-standard-way-to-write-redux-4fh9</link>
      <guid>https://dev.to/zahidhasan2806/redux-toolkit-a-standard-way-to-write-redux-4fh9</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Redux Toolkit?&lt;/strong&gt;&lt;br&gt;
Redux Toolkit is the new reliable way to consist of Redux into your project. It attempts to resolve a number of the common issues developers expressed in using the original Redux package. along with an excessive amount of setup, too complex, and desiring too many addon applications to function. With the toolkit, there may be much less configuration and a lot more work is performed under the hood and middlewares had been included with async thunks. while the original Redux package become very unopinionated and allowed you to choose which packages you desired to use with it, the new Redux Toolkit is opinionated as it comes with those packages out of the sector. you can consider Redux Toolkit as the Create React App for Redux as it comes with matters that will help get you started faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API  includes Redux Toolkit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;configureStore():&lt;/strong&gt; wraps createStore to provide simplified configuration options and good defaults. it could automatically integrate your slice reducers, provides something Redux middleware you supply, consists of redux-thunk by default, and enables the use of the Redux DevTools Extension.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;createReducer():&lt;/strong&gt; Reducer support directly mapping specific action types to case reducer function that will update the state when that action is dispatched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;createAction():&lt;/strong&gt; Based on given action type string it generates a action creator function.This function has its own toString() method so that it can be used as a type constant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;createSlice():&lt;/strong&gt; createSlice is a higher-order function that accepts an initial state, an object full reducer function, and a slice name. it automatically generates action creators and action types that correspond to the reducers and state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;createAsyncThunk:&lt;/strong&gt; Accepts an action type string and a function that returns a promise, and generates a thunk that dispatches pending/fulfilled/rejected action types based on that promise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;createEntityAdapter:&lt;/strong&gt; Generates a set of reusable reducers and selectors to manage normalized data in the store.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;createSelector():&lt;/strong&gt; Selectors typically expect the Redux state object as an argument, while slice reducers only have access to a specific subset of the entire Redux state.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>reduxtoolkit</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Redux-A technology to know</title>
      <dc:creator>MD Zahid Hasan</dc:creator>
      <pubDate>Fri, 25 Feb 2022 11:31:50 +0000</pubDate>
      <link>https://dev.to/zahidhasan2806/redux-a-technology-to-know-3e95</link>
      <guid>https://dev.to/zahidhasan2806/redux-a-technology-to-know-3e95</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Redux?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Considering Javascript Redux is a predictable state management library and for React, Redux is the most popular State container. It basically helps to avoid the Prop drilling nature of React. It holds all the states within the app and each component have access to this store. The core concepts of Redux are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Store:&lt;/strong&gt; Everything that changes within an app is actually represented by a javascript object called the store. Store stored all the states of an application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application state is immutable:&lt;/strong&gt; When states changes in an application Redux clone the state object and modify it and it replaces the original state with the new copy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reducers:&lt;/strong&gt; Reducers are pure JavaScript functions that perform the action to update the state and return the new state. It takes the current value of a state, takes the action depending on the action type, and returns the new state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oKwW63if--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jls0f9nmqz5aqj1m1mw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oKwW63if--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jls0f9nmqz5aqj1m1mw.png" alt="Image description" width="880" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Redux data flow:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Store stores the states&lt;/li&gt;
&lt;li&gt;Event occurs in the UI&lt;/li&gt;
&lt;li&gt;That Event dispatch an action&lt;/li&gt;
&lt;li&gt;In a predictable way, Reducer updates the states&lt;/li&gt;
&lt;li&gt;UI accept the updated states&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Redux:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redux can be used client and server-side both.&lt;/li&gt;
&lt;li&gt;Redux is easy to test and also optimizes the performance of the application.&lt;/li&gt;
&lt;li&gt;We can easily persist some of state to the local store.&lt;/li&gt;
&lt;li&gt;We can maintain Redux easily&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages of Redux:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In a small project, everyone tries to avoid complex patterns like Redux.&lt;/li&gt;
&lt;li&gt;When data come from a single data source per view.&lt;/li&gt;
&lt;/ul&gt;

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