<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adedunye Adedayo on Medium]]></title>
        <description><![CDATA[Stories by Adedunye Adedayo on Medium]]></description>
        <link>https://medium.com/@samfeolu?source=rss-6bed8c6ff431------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BQxASTvnJgngkX8-.jpg</url>
            <title>Stories by Adedunye Adedayo on Medium</title>
            <link>https://medium.com/@samfeolu?source=rss-6bed8c6ff431------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 03:29:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samfeolu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[State Management Made Easy (Terminologies Used)]]></title>
            <link>https://medium.com/@samfeolu/state-management-made-easy-terminologies-used-26dd4473cf62?source=rss-6bed8c6ff431------2</link>
            <guid isPermaLink="false">https://medium.com/p/26dd4473cf62</guid>
            <category><![CDATA[vuex]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[terminology]]></category>
            <dc:creator><![CDATA[Adedunye Adedayo]]></dc:creator>
            <pubDate>Fri, 17 Jan 2020 14:01:59 GMT</pubDate>
            <atom:updated>2020-03-03T08:53:29.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*5bWd2c5u982BaVAWp3Spjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*5bWd2c5u982BaVAWp3Spjw.png" /><figcaption>State Management</figcaption></figure><p>In this New World order, any developer that doesn’t know about state management is not considered a serious developer, many have because of this tried to study and grasp the fundamentals and even the advances of state management.</p><p>Permit me to ask, Who else gets utterly confused whenever they open an article or watch a video that talks about state management. At a point i was, and I discovered that I wasn’t alone and that it didn’t start with me, neither will it end with me.</p><h4>Why The confusion ?</h4><p>Most at times whenever developers try to learn about state management, whichever one it is (Redux, Vuex, Ngrx, Ngxs e.t.c), the number one factor that discourages them and make it look like state management is a huge thing is the terminologies. Many tutorials just go into the teachings and do not bother to teach what those words mean, they rather jump into how they work, and i must confess that is a very bad way to learn. That is a kind of learning that you know what to do but you do not know the underlying principles of what you do.</p><p>That is the reason for this article. I have noticed that across this different state management tools, terminologies being used are the same, hence i brought together this terminologies into one article to help beginners and expert alike to understand it in a layman understanding. I will try as much as possible to start explaining them in order of importance and relevance.</p><p>Table of Content</p><blockquote>1. What is State Management<br>2. Store / State<br>3. Dispatch<br>4. Payload<br>5. Action<br>6. Reducer</blockquote><h3>1. WHAT IS STATE MANAGEMENT ?</h3><p>We cannot start explaining state management without first asking this question. What is State management? Well state management like the name purely says is just managing the state of your application. (I bet you were expecting me to say something far fetched, the real truth is that that is the simple definition.) Look at the two words <strong>State</strong> and <strong>Management</strong></p><blockquote><strong>State Definition:</strong></blockquote><blockquote>State is just the current status of your application, That is to say, the <strong>current</strong> information that is available in your application. <br>According to the dictionary, state is <strong>the particular condition that someone or something is in at a specific time.<br></strong>So applying this to computer programming now, <strong>State is the particular condition that your application is in at a specific time.<br></strong>As Simple as That</blockquote><blockquote><strong>Management Definition:</strong></blockquote><blockquote>Management according to the dictionary means <strong>the process of dealing with or controlling things or people.</strong> <br>Applying that to state now You have this definition<br><strong>State Management is the the process of dealing with or controlling State</strong></blockquote><p><strong>STATE MANAGEMENT CONCLUSION<br></strong>Now we arrive at this conclusion</p><blockquote><strong>State Management is the the process of dealing with or controlling the particular condition that your application is in at a specific time.</strong></blockquote><h3>2. STORE / STATE</h3><p>In most state management tools, you would often come across the word <strong>Store</strong> or <strong>State</strong>. Please do not be confused they are just as the look and the literally mean the same thing. Think of a store as a normal store in your house where you keep all your goods and valuable. In term of programming now, a store is just a fancy name for a usually large object that contains information which you have specified that you want it to contain.</p><h3>3. DISPATCH</h3><p>You would often hear most tutorial say “Dispatch an action” and You will mostly use dispatch in most state management apps like this</p><pre>store.dispatch()</pre><p>But hey, what the hell is dispatch? Well like is said earlier you’ll mostly hear and see tutorials use the word “Dispatch an action” well, they literally mean “call an action”. It’s similar to saying “Call a function”. So dispatch is just a fancy name for calling something that looks like a function. It like saying start an action which has been already specified. Imagine a set of commands that you have listed like this</p><pre>command 1 = sit<br>command 2 = stand<br>command 3 = sleep</pre><p>Imagine that to set this commands into motion all you have to do is dispatch them. Like say</p><pre>dispatch(command 1)</pre><p>Then the person involved sits down. That is the way dispatch works.</p><p>Or in another Scenario, A mail man that has a ton of letters waiting to be delivered to people. Whenever he is ready to deliver the letter, (pause for a second and guess what he does) Yes you got it right….. He dispatches them.</p><h3>4. PAYLOAD</h3><p>Payload simply means data or information</p><h3>5. ACTIONS</h3><p>Now you know that your store is a house for the information in your application, this information can be updated, can be deleted, and new information can be added to the store also. But how do we know the kind of operation we want to perform on the store? whether we want to add data to the store or remove data from the store? this is where the action comes to play its part.</p><p>An action is just an object that tells your reducer what you want to do to your store, In other words, an action tells your reducer what to do.</p><p>For example, you have a store and you want to be able to do two things to your store to <strong>ADD</strong> data and <strong>REMOVE</strong> data. You need to create an action called <strong>ADD </strong>and <strong>REMOVE. </strong>Now let’s assume you want to <strong>add</strong> data to your store, You need to call (dispatch) your action called <strong>ADD</strong> which then tells your reducer that</p><pre>Hey Reducer! I want to add this and this data to the store</pre><p>If you also want to remove data from it you just call (dispatch) the action called <strong>REMOVE </strong>and like earlier, this action tells your reducer</p><pre>Hey Reducer! Remove this and this data from the store</pre><p>Most action looks like an object that contains two basic properties</p><blockquote>A compulsory property called type<br>and<br>An optional property called the payload (this varies based on the type of the action)</blockquote><p>Action is fully described in the object below</p><pre>const action = { type: &#39;Add&#39;, payload: &#39;&#39;}</pre><p>Now, action can be created but the way of creating actions differs from each other according to the state management tool you are using. But it will mostly look like this in most tools</p><p>Note: The action does not perform the operation specified, it is the reducer that performs the actual operation. The action only tells the reducer the kind of operation to perform and the reducer performs that operation on the store based on the information that the action supplies to it. This leads us to the next in line. Reducers!</p><h3>6. REDUCERS</h3><p>Reducers are kind of like the powerhouse of state management, in that they are the ones that perform the actual changes on our store. Now be warned that it is a bad practice to change your state directly. It is always advised to create a copy of the existing one and perform what you want to perform on that copy.</p><p>A reducer is just a function that takes two arguments the state and the action.<br>Now, remember that our action has a type and a payload. The reducer then performs an operation on the state provided based on the action provided. In summary, reducer functions like this:</p><pre>(state, action) =&gt; newState</pre><p>It is basically a pure function that takes in a <strong>state </strong>argument and an <strong>action</strong> argument and returns a <strong>new state</strong> for us. A typical reducer would look like this.</p><p>To learn more on reducers you can visit this site</p><p><a href="https://www.robinwieruch.de/javascript-reducer">What is a Reducer in JavaScript/React/Redux? - RWieruch</a></p><p>With all this said, I believe you should have a firm grasp of these confusing terminologies.</p><p>In summary</p><p><strong>STATE</strong> , is the current situation of your application</p><p><strong>STORE</strong> is the house where information about your application is kept. It is used interchangeably with <strong>STATE </strong>at times</p><p><strong>DISPATCH</strong> means to start something.</p><p><strong>A PAYLOAD </strong>is any data supplied. It could be a string, an array, an object, a number it could be anything!</p><p><strong>AN ACTION </strong>is a description that gives details to the reducer about what kind of operation to be done to the store and if that operation requires a payload which I described above, the action also supplies it. (I wonder why they call it action, it should have been called a descriptor or a pointer or a name that is well descriptive of what it does… Durhh)</p><p><strong>A REDUCER</strong> is a function that performs the kind of operation which was specified in the action</p><p>If this article has helped you please do well to <strong>clap</strong> and <strong>share</strong>. Thanks!</p><p>Also If you feel there is any other Terminology you think I should add to this article or create another separate one for, <strong>feel free to hit me in the comments section</strong></p><p>You can also reach me via twitter @<a href="https://www.twitter.com/adedayojs">adedayojs</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26dd4473cf62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developer’s Quick Reference (JavaScript)]]></title>
            <link>https://medium.com/@samfeolu/developers-quick-reference-javascript-182fefd3fd27?source=rss-6bed8c6ff431------2</link>
            <guid isPermaLink="false">https://medium.com/p/182fefd3fd27</guid>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[array-methods]]></category>
            <category><![CDATA[reference]]></category>
            <category><![CDATA[sting-operation]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Adedunye Adedayo]]></dc:creator>
            <pubDate>Wed, 15 Jan 2020 10:28:29 GMT</pubDate>
            <atom:updated>2020-01-16T16:15:46.882Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*42hAIMc3xNSvTBZD.jpg" /></figure><p>Stack Over Flow is always on the receiving end of request such as ‘Regex for Phone number’ ‘Regex for email’ However stack overflow can contain so much answers to a simple question of yours that in the end developers become confused.</p><p>Here in this post i have hand picked some of the best solutions that will meet your daily frequent need as a developer</p><h3>REGULAR EXPRESSIONS</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53e3377317a44d4905d9aabc040a36fa/href">https://medium.com/media/53e3377317a44d4905d9aabc040a36fa/href</a></iframe><h3><strong>STRING OPERATIONS</strong></h3><p>Convert to “Title Case”</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d21c1bff883a497677bf80519b0044f4/href">https://medium.com/media/d21c1bff883a497677bf80519b0044f4/href</a></iframe><p>Remove non word character from a string</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4c4d7c06b8280256cd543fd2bb10823/href">https://medium.com/media/f4c4d7c06b8280256cd543fd2bb10823/href</a></iframe><p>Reverse a String</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58b6c0718fe00a2d496b9a76de4cf9bc/href">https://medium.com/media/58b6c0718fe00a2d496b9a76de4cf9bc/href</a></iframe><h3>ARRAY OPERATIONS</h3><p>Loop Through Numbers</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7d2c29f735d428d11398c62a3569225/href">https://medium.com/media/c7d2c29f735d428d11398c62a3569225/href</a></iframe><p>Minimum Number In an array</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ef19342fcdd4aaba70cc256a4f58b53/href">https://medium.com/media/1ef19342fcdd4aaba70cc256a4f58b53/href</a></iframe><p>Maximum Number in an array</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f83117234d0c18033af78cfcc0de8e2e/href">https://medium.com/media/f83117234d0c18033af78cfcc0de8e2e/href</a></iframe><p>Sum Numbers in an array</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f1bf32e845eb1342565c5fc3a8e1bc88/href">https://medium.com/media/f1bf32e845eb1342565c5fc3a8e1bc88/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=182fefd3fd27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Your Npm Packages Globally Without ‘sudo’ In 3 Steps]]></title>
            <link>https://medium.com/@samfeolu/install-your-npm-packages-globally-without-sudo-in-3-steps-d62c96a76b89?source=rss-6bed8c6ff431------2</link>
            <guid isPermaLink="false">https://medium.com/p/d62c96a76b89</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[npm-inst]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[npm-permission]]></category>
            <category><![CDATA[sudo]]></category>
            <dc:creator><![CDATA[Adedunye Adedayo]]></dc:creator>
            <pubDate>Thu, 20 Jun 2019 05:13:40 GMT</pubDate>
            <atom:updated>2019-06-20T06:18:21.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HK10Vlq_ZJPQbRLG3Zu-7g.png" /><figcaption>That Frustrating moment on my pc</figcaption></figure><p>Who else hates that scenario where you want to install an Npm package globally but you keep getting that annoying red text showing up on your terminal, all because of something called ‘permission error’. Well, that’s all about to change.</p><h3>Why Permission Error</h3><p>Permission error as the name implies only happens when you do not have sufficient access to anything be it a folder, a file, a function even boiling down to real life situation such as kissing someone else girlfriend in their presence (that’s a solid permission error).</p><p>By default when you install node, it sets up some kind of settings which I would not delve into fully. Part of these settings it that node needs to save globally installed files somewhere that it can access it anytime these files are needed. At the point of installing Node, this folder is set to somewhere inside another folder called usr/bin. This usr/bin is a folder that needs admin permission to allow writing and you whenever you are installing a module either globally or locally, you are actually doing a write operation. The only difference now is that when you install locally, you are writing to that same folder you are currently in but when you install globally, you are writing to that folder which is inside the ‘usr/bin’ folder and this folder needs admin permission to enable writing to it.</p><h3>Why Sudo</h3><p>Sudo comes to play where you prefix your command with sudo. For example</p><pre>sudo npm install -g jest</pre><p>After doing this, you are asked to input your password and this allows us to gain admin access to write into that folder. However, sudo is not a good practice as it could compromise security. Hackers could hack you through packages that you have given full access to.</p><h3>Way To Go</h3><p>This issue can be solved easily by changing the default folder for storing global files into another folder that doesn’t need admin permission before you can write to it.</p><p>It is usually recommended to back up your computer before doing this incase you do it the wrong way.</p><ol><li>On the command line in your home directory create a folder for global installations</li></ol><p>mkdir ~/.npm-global</p><h4>Explanation</h4><p>The <strong>~</strong> signifies your home directory<br>The<strong> .npm-global</strong> is the name of the directory you are creating (whichever name you like)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pabo-iAoCxYnb0EStKrVZw.png" /><figcaption>In my case I already have the directory created. You notice that it replaced ~ with /Users/techkny. That’s my own home directory.</figcaption></figure><p>2. Configure Npm to point to the new directory created</p><p>Still on the command line</p><ul><li>npm config set prefix &#39;~/.npm-global&#39;</li></ul><p>Note: Don&#39;t forget that .npm-global is the name of the directory I created above</p><blockquote>Note: You Could skip the remaining steps and proceed to step 6 which is a shorthand for step 3 -5. It is however advised to not skip them as you never can tell if it could break something in the future</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_bLg-q8ODFi1Nn1KIElfw.png" /><figcaption>Configure Npm</figcaption></figure><p>3. In your preferred text editor, open or create a <strong>~/.profile</strong> file</p><p>Warning:</p><p>This is where I got it all messed up and I don’t want you to fall into the same mistake. Creating a ~/.profile file means creating a .profile file in your home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZY9TlbE1SJ_1GIAppw9pKA.png" /><figcaption>Note the time created this morning</figcaption></figure><p>4. Open the .profile file you just created and add this line</p><p>export PATH=~/.npm-global/bin:$PATH</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HAhmQ27s-EdSYYXTOw6D_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sgqvRIXfwlriTNlU040YOg.png" /></figure><p>5. Update Your environmental variable to include the path you just specified.</p><p>Enter your terminal once again and put in this code</p><p>source ~/.profile</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ljt-WF67WPxLgtdFN_EEHA.png" /></figure><p>6. In case You get an error while trying to use the globally installed packages, you must have done step 3–5 wrongly. Then do the shorthand method. Add the path of the newly created directory to your environment variables</p><p>Put on your command line now</p><pre>export PATH=~/.npm-global/bin:$PATH</pre><p>And that’s it you are done. Comments and reviews are welcomed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d62c96a76b89" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>