<?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>Forem: Elizabeth Villalejos</title>
    <description>The latest articles on Forem by Elizabeth Villalejos (@misselliev).</description>
    <link>https://forem.com/misselliev</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%2F140031%2F22099ca8-dbc8-4150-8490-a26bcdc5c14b.jpg</url>
      <title>Forem: Elizabeth Villalejos</title>
      <link>https://forem.com/misselliev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/misselliev"/>
    <language>en</language>
    <item>
      <title>Upgrade your React game with TypeScript: Routes</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Tue, 18 Aug 2020 01:29:42 +0000</pubDate>
      <link>https://forem.com/misselliev/upgrade-your-react-game-with-typescript-routing-4c59</link>
      <guid>https://forem.com/misselliev/upgrade-your-react-game-with-typescript-routing-4c59</guid>
      <description>&lt;p&gt;Hello there! This is the part of the tutorial where we make navigation magic ✨ happen.&lt;/p&gt;

&lt;p&gt;In order to start, we first need to add some dependencies to our project with &lt;code&gt;npm i react-router-dom @types/react-router-dom&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you remember, in our Menubar component we have everything set up so we could navigate between two links: &lt;code&gt;/&lt;/code&gt; for Home and &lt;code&gt;/dates&lt;/code&gt; for Tour Dates.&lt;/p&gt;

&lt;p&gt;Let's create those.&lt;/p&gt;

&lt;p&gt;In your src folder, create a Pages folder and inside create two files: &lt;code&gt;Home.tsx&lt;/code&gt; and &lt;code&gt;TourDates.tsx&lt;/code&gt;. We're using the &lt;code&gt;.tsx&lt;/code&gt; extension instead of the &lt;code&gt;.ts&lt;/code&gt; because the first one will allow us to use JSX.&lt;/p&gt;

&lt;p&gt;For now, I'll leave both components really simple but you can go and add whatever you want on them.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Great, now we have our two components all typed up and pretty. Now, we have to create a &lt;code&gt;Routes.tsx&lt;/code&gt; where we place all of our preferred routes.&lt;/p&gt;

&lt;p&gt;In this case, our &lt;code&gt;Routes.tsx&lt;/code&gt; would look something like this. &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;And finally, we have to make sure we add our Router component to make everything happen in &lt;code&gt;App.tsx&lt;/code&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;And ✨ that's it! You can now go back and forth between &lt;code&gt;\&lt;/code&gt; and &lt;code&gt;\dates&lt;/code&gt; in your Menubar.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--glc1Fq4o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/zt3l2hP.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--glc1Fq4o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/zt3l2hP.jpg" alt="Chi working zone" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
Dulce, my local PM, checking out your cool routing



&lt;p&gt;&lt;br&gt;&lt;br&gt;
I hope you found this helpful, stay safe and please remember to take a break.&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment, meme or dog photos swap.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Upgrade your React game with TypeScript: More on Types</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Thu, 13 Aug 2020 01:23:50 +0000</pubDate>
      <link>https://forem.com/misselliev/upgrade-your-react-game-with-typescript-more-on-types-5o8</link>
      <guid>https://forem.com/misselliev/upgrade-your-react-game-with-typescript-more-on-types-5o8</guid>
      <description>&lt;p&gt;Types are essentially, defining the data type of our variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Eli {
  name: string;
  age: number;
  likes: string[];
  coffeesDrankToday?: number[]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For declaring arrays, we state the type of data the array has to contain and then use the brackets. Another way to declare them can be this way &lt;code&gt;likes: Array&amp;lt;string&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also, remember that you can make a variable optional within an interface writing a &lt;code&gt;?&lt;/code&gt; before the data type.&lt;/p&gt;

&lt;p&gt;But sometimes, we need something a bit more complex.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qa38hZnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qMswRvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qa38hZnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qMswRvs.png" alt="My Chi Dulce, contemplating her choices"&gt;&lt;/a&gt;&lt;/p&gt;
Dulce, contemplating her type choices



&lt;p&gt;Maybe we need to load an interface as an empty object, which we can do like this &lt;code&gt;daily: &amp;lt;YourInterfaceHere&amp;gt;{}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes we don't know what kind of data we're dealing with when using an API or maybe we want to opt-out of type checking for a particular variable. In this case, we can use &lt;code&gt;any&lt;/code&gt;. The downside of using it is that we're not taking advantage of what TypeScript has to offer us so it's highly discouraged to use.&lt;/p&gt;

&lt;p&gt;The opposite of &lt;code&gt;any&lt;/code&gt; is using &lt;code&gt;void&lt;/code&gt;, which is the absence of all types at all. This is common in functions that don't return a value. &lt;/p&gt;

&lt;p&gt;You can even create your own types from an interface!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export interface LoadDayAction {
    type: string;
    payload: Day;
}

export interface ErrorLoadAction {
    type: string[];
    payload: Error;
}

export type DailyTypes = LoadDayAction | ErrorLoadAction;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now you could use &lt;code&gt;LoadDayAction&lt;/code&gt; or &lt;code&gt;ErrorLoadAction&lt;/code&gt; to define another variable. &lt;/p&gt;

&lt;p&gt;You can read up further on types &lt;a href="https://www.typescriptlang.org/docs/handbook/basic-types.html"&gt;here.&lt;/a&gt;&lt;br&gt;
_&lt;/p&gt;

&lt;p&gt;I hope you found this helpful, stay safe and please remember to take a break.&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment, meme or dog photos swap.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Show off with Github's README</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Fri, 07 Aug 2020 22:16:28 +0000</pubDate>
      <link>https://forem.com/misselliev/show-off-with-github-s-readme-40eh</link>
      <guid>https://forem.com/misselliev/show-off-with-github-s-readme-40eh</guid>
      <description>&lt;p&gt;Github now allow us to create a README file for our profile to display whatever fancies us. How about taking advantage of this feature to show off a little? Here are a few very cool tools I found to take your README to the next level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating your README ⚒️
&lt;/h2&gt;

&lt;p&gt;In case you don't have a personal README, it's as easy as creating a new repository that’s the same name as your username.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now off to the code 🧰
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Github Readme Stats
&lt;/h3&gt;

&lt;p&gt;Show all of your numbers in a cool personalizable image. It lists the total of your commits, stars, PR's, issues.&lt;br&gt;
You can look at the repo with instructions &lt;a href="https://github.com/anuraghazra/github-readme-stats"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Waka time updates
&lt;/h3&gt;

&lt;p&gt;Waka time is a plugin for your editor that can help you track how much time you're spending coding. It's important to notice that it won't track the time your editor is open, but the actual time you spend writing on it.&lt;br&gt;
You can look at the Github Action &lt;a href="https://github.com/marketplace/actions/waka-readme#update-your-readme"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Show off your languages
&lt;/h3&gt;

&lt;p&gt;I also found a really cool Github Action that automatically groups your projects by language in a nifty table that gets loaded into your README.&lt;br&gt;
You can look at the Github Action &lt;a href="https://github.com/marketplace/actions/profile_stack"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Even more stats!
&lt;/h3&gt;

&lt;p&gt;I have a thing with stats and tables, sorry. This Github Action shows you cool things like your most productive time of day, whether you are an early bird or a night owl, favorite languages you code in and more.You can look at it &lt;a href="https://github.com/marketplace/actions/profile-readme-development-stats"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Hook up your blog posts too!
&lt;/h3&gt;

&lt;p&gt;There's this great Github Action that allows you to update dynamically your README each time you write a new blog post. It works with Dev.To, Medium, Wordpress, StackOverflow and many more. You can look at it &lt;a href="https://github.com/marketplace/actions/blog-post-workflow"&gt;here.&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
I hope you found this helpful, stay safe and please remember to take a break.&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment, meme or dog photos swap.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>github</category>
      <category>branding</category>
    </item>
    <item>
      <title>Upgrade your React game with TypeScript: Interfaces, types and components</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Fri, 07 Aug 2020 00:55:06 +0000</pubDate>
      <link>https://forem.com/misselliev/interfaces-types-and-components-50e6</link>
      <guid>https://forem.com/misselliev/interfaces-types-and-components-50e6</guid>
      <description>&lt;p&gt;Now it's time to put some flavor on our app and create a few components for our app. To do so, we need to understand some TypeScript concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types
&lt;/h2&gt;

&lt;p&gt;Types are for letting TS know what kind of data for a specific property should expect.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface CandyBar{
  name: string;
  okToSell: boolean;
  inventory: number;
  categories?: string[];
  howManyinTheFreezer: (bars: number)=&amp;gt; number,
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;These are just a few examples of the types. By adding the &lt;code&gt;?&lt;/code&gt; to a type we make it optional. For functions we have to make sure to specify the type for its parameters and for what it will return.&lt;/p&gt;
&lt;h2&gt;
  
  
  Interfaces
&lt;/h2&gt;

&lt;p&gt;An interface is what allows us to create the syntax for a class. Interfaces can be extended dynamically, so we can do something like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Dog{
  name: string,
  age: number,
}
interface Breed extends Dog{
  breed: string,
}
interface Dog{
  isFriendly: boolean,
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Here we're extending Dog's interface with Breed and then we're adding types to it.&lt;/p&gt;

&lt;p&gt;Ok, got it 📝.&lt;/p&gt;

&lt;p&gt;There's one extra thing to add before going hard into our first component, though.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prop-types
&lt;/h2&gt;

&lt;p&gt;React has a very useful way to check for types too, &lt;code&gt;prop-types&lt;/code&gt; and if we mix it with TypeScript, we can make sure to check from compiler to runtime. Isn't it great? &lt;/p&gt;

&lt;p&gt;We can take advantage of it by doing the following:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i --save-dev @types/prop-types prop-types
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And making sure in our component we add &lt;code&gt;import PropTypes from 'prop-types';&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating our first component
&lt;/h2&gt;

&lt;p&gt;Ok, now we're good to go. I decided to go slow and start with a component that won't require a lot since we're just starting: a Navbar.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;When we do stateless components like this, practically the only change our code has is the &lt;code&gt;Menubar: React.FC&lt;/code&gt; part right at the very beginning. In that part, we're specifying that Menubar's type as a React Functional Component. The rest of the code is the usual HTML with Tailwind classes.&lt;/p&gt;

&lt;p&gt;Now, how about something that requires us to use Props? We're doing a Banner component. The prop is going to be an image we're going to give it since we want to be able to change it up easily.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
Now in &lt;code&gt;React.FC&amp;lt;Props&amp;gt;&lt;/code&gt; we're letting TypeScript now this component will need props, destructuring we're letting it know it specifically needs bannerImg and an altImg prop.

&lt;p&gt;Now all we need to do it's call it in App.tsx, give it the props we defined and we're good to go.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;I hope you found this helpful, stay safe and please remember to take a break.&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment, meme or dog photos swap.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Upgrade your React game with TypeScript: Setup.</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Wed, 15 Jul 2020 23:12:05 +0000</pubDate>
      <link>https://forem.com/misselliev/upgrade-your-react-game-with-typescript-setup-3bnk</link>
      <guid>https://forem.com/misselliev/upgrade-your-react-game-with-typescript-setup-3bnk</guid>
      <description>&lt;p&gt;Lately, I've been working on polishing my JS skills, specifically, React and TypeScript has been on my radar for a while so I thought it'd be a great idea to work on an app to incorporate both.&lt;/p&gt;

&lt;p&gt;Let's go through a quick recap of React and touch base on what TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  React and TypeScript walk into a bar...
&lt;/h2&gt;

&lt;p&gt;React is a front-end JavaScript developed by Facebook. It follows a component-based approach which helps us to build reusable UI components. It also uses a virtual DOM instead of the real DOM, this helps us re-render just certain parts of the app instead of the whole thing.&lt;/p&gt;

&lt;p&gt;TypeScript essentially is a strict, typed superset of JS. TypeScript compiles to readable, standards-based JS. The main thing about TypeScript is that it allows us to add static types to our JS code and doing so helps us catch errors earlier in the debugging process.&lt;/p&gt;

&lt;p&gt;Less time debugging AND clearer code? Sign 👏 me 👏 up 👏.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;Thankfully, there's a Create-React-App template that already does the heavy lifting for us that includes TypeScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app my-app-name --template typescript
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next stop, setting up our linters because we're all about that clean code.&lt;/p&gt;

&lt;p&gt;We're going to be using ESLint and Prettier. Let's set up our local env running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev eslint@6.8.x @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react prettier eslint-config-prettier eslint-plugin-prettier --dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We're also going to need to set up their configuration files. On the root of your project, create &lt;code&gt;.eslintrc.js&lt;/code&gt; and use this configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  parser: "@typescript-eslint/parser", // Specifies the ESLint parser
  parserOptions: {
    ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
    sourceType: "module", // Allows for the use of imports
    ecmaFeatures: {
      jsx: true // Allows for the parsing of JSX
    }
  },
  settings: {
    react: {
      version: "detect" // Tells eslint-plugin-react to automatically detect the version of React to use
    }
  },
  extends: [
    "plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
    "plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin
    "prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
    "plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
  ],
  rules: {
    // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
    // e.g. "@typescript-eslint/explicit-function-return-type": "off",
  },
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For Prettier we need to create also in the root, a file called &lt;code&gt;.prettierc.js&lt;/code&gt; with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  semi: true,
  trailingComma: "all",
  singleQuote: true,
  printWidth: 120,
  tabWidth: 4
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And to tie it all together and make it even easier for us, add the following line to your &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That way we can simply run ´npm run lint´ and have everything working for us.&lt;/p&gt;

&lt;p&gt;We're also going to be including Github Actions to make sure that even if we forget to run the interest, our code is going to be checked.&lt;/p&gt;

&lt;p&gt;At root level, add &lt;code&gt;.github/workflows&lt;/code&gt; and in it, create a file called &lt;code&gt;linters.yml&lt;/code&gt; with the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Linters

on: pull_request

env:
  FORCE_COLOR: 1

jobs:
  eslint:
    name: ESLint
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: "12.x"
      - name: Setup ESLint
        run: |
          npm install --save-dev eslint@6.8.x @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react --dev
          [ -f .eslintrc.js ] 
      - name: ESLint Report
        run: npx eslint .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When you open a PR, you should see the linters working.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional
&lt;/h2&gt;

&lt;p&gt;Since we're setting up everything, I want to make time to also set up our styling dependencies. I usually use Semantic UI, but this time I'm going to be using Tailwind CSS. &lt;/p&gt;

&lt;p&gt;Tailwind is a utility-first CSS framework for custom interfaces. It gives us a lot of functionality out of the box.&lt;/p&gt;

&lt;p&gt;Depending on what you need, there are two types of setup: the basic one and the production one. I used &lt;a href="https://daveceddia.com/tailwind-create-react-app/#production"&gt;this &lt;/a&gt;great resource by Dave Ceddia.&lt;/p&gt;

&lt;p&gt;That's it for our setup process. In our next installment, we'll talk about writing our first TypeScript component.&lt;/p&gt;

&lt;p&gt;I hope you found this helpful, stay safe and please remember to take a break.&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment, meme or dog photos swap.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>#remotelife 101</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Tue, 17 Mar 2020 20:56:19 +0000</pubDate>
      <link>https://forem.com/misselliev/remotelife-101-522h</link>
      <guid>https://forem.com/misselliev/remotelife-101-522h</guid>
      <description>&lt;p&gt;Given the recent state of the world, a lot of people have been asked to start working from home if possible. We're privileged that most of us in this industry are able to.&lt;/p&gt;

&lt;p&gt;While this is great, not a lot of our industry is already remote. So being thrown into this, on top of everything that is going on, can be challenging.&lt;/p&gt;

&lt;p&gt;I'm enrolled in &lt;a href="https://www.microverse.org/?grsf=i244iw"&gt;Microverse&lt;/a&gt;, a software development program that's fully remote, so I have some experience that could be useful to you if you're just treading water on remote life.&lt;/p&gt;

&lt;h3&gt;
  
  
  Routines are what makes the world go round
&lt;/h3&gt;

&lt;p&gt;I know it's hectic since you might have a lot going on at home, but try to outline a routine. Set up a calendar with your work hours and let everyone home that, while you are physically present, you are busy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make time for things that matter (and block it on your calendar)
&lt;/h3&gt;

&lt;p&gt;Schedule your lunch break, seriously. It's easier than you think to skip breaks and lunches now.&lt;/p&gt;

&lt;h3&gt;
  
  
  Remember to take breaks
&lt;/h3&gt;

&lt;p&gt;We can get very absorbed into what we're doing that we completely lost track of time and since we're not going &lt;em&gt;out&lt;/em&gt; for lunch, it's easy to stay put for hours. To tackle this I personally use &lt;a href="https://chrome.google.com/webstore/detail/postureminder/dkmkfopiihabelocpelofchappjjnpkm"&gt;Posture Minder&lt;/a&gt;, a chrome extension that lets you know when its time to take a small break and when to check your posture.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resist the urge to be in your PJs all-day
&lt;/h3&gt;

&lt;p&gt;This comes along with the routine point. It's very tempting but in order to get your mindset into 'work mode', it's better to change up into something else that's equally comfortable. (Slippers allowed though, we're not going all business attire like)&lt;/p&gt;

&lt;h3&gt;
  
  
  Take a few minutes a day to clean up clutter in your new workspace
&lt;/h3&gt;

&lt;p&gt;A cluttered area will not help you out. You will probably make video calls too, so while we all get that we're dealing with what we have, make a bit of effort to keep it clean and lean.&lt;/p&gt;

&lt;h3&gt;
  
  
  Video calls are your friends
&lt;/h3&gt;

&lt;p&gt;Slack is good but now that we're being more isolated, it doesn't hurt to schedule a call or two. Do you have a question about something? Ask to jump on a quick call. It might get you clearer answers than a slack message plus you get social interaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep an eye on your mental health
&lt;/h3&gt;

&lt;p&gt;Productivity is cool but give yourself a break. If you need to take a longer lunch break on some days, it's okay. Try to get yourself by a window to get some sun, pet your dog, make yourself some tea. Everything works out great when you are good and great. Take a minute.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5fSGcq04--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/OvKkU0K.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5fSGcq04--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/OvKkU0K.jpg" alt="Chi working zone" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
Dulce, my local Project Manager, making sure things are in check





&lt;h3&gt;
  
  
  Mind your noise
&lt;/h3&gt;

&lt;p&gt;Houses are crowded now, but make sure to let people at home know that you're on call. Your standup doesn't need to know someone forgot to do the dishes. Also, it's perfectly okay to mute yourself if you're not talking, just be present and &lt;em&gt;don't forget&lt;/em&gt; unmute yourself when talking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Write a list
&lt;/h3&gt;

&lt;p&gt;What are your top 3 things that you want to get done today? Write them down. Schedule them, label them if it helps you out. (I use Todoist for this and it has worked wonders). &lt;br&gt;
Our headspace can be a bit of scattered right now, so help yourself stay on track.&lt;/p&gt;

&lt;h3&gt;
  
  
  Communication is key
&lt;/h3&gt;

&lt;p&gt;If you need to take some time to help out a family member, do some errands or are just having a hard time, it is completely understandable. Reach out to your team. It will be generally okay and adjustments can be made as long as you don't leave them in the dark. We're in this together.&lt;/p&gt;

&lt;p&gt;I hope you found this helpful, stay safe and please remember to take a break.&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment, meme or dog photos swap.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>remote</category>
      <category>career</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Easy as a pie Big O notation: A note about Objects</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Thu, 12 Mar 2020 20:47:26 +0000</pubDate>
      <link>https://forem.com/misselliev/easy-as-a-pie-big-o-notation-a-note-about-objects-3gn9</link>
      <guid>https://forem.com/misselliev/easy-as-a-pie-big-o-notation-a-note-about-objects-3gn9</guid>
      <description>&lt;p&gt;An object is an unordered data structure where everything is stored in key-value pairs.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let superDog = {
Name: “Dulce”,
Breed: “Chihuahua”,
Weight: “2 pounds” }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Objects are great when storing in order is not a concern and we need to be fast at inserting and removing data.&lt;/p&gt;

&lt;h3&gt;
  
  
  But exactly, how fast?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Insertion: &lt;em&gt;O(1)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Removal: &lt;em&gt;O(1)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Access: &lt;em&gt;O(1)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Searching: &lt;em&gt;O(N)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It works in constant time because since we have no order in our data, we technically don’t have a beginning or end so it doesn’t really matter in which order data is added. &lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment or meme.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>algoritms</category>
    </item>
    <item>
      <title>A note about OpenSSL error on Rails.</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Sat, 07 Mar 2020 00:00:34 +0000</pubDate>
      <link>https://forem.com/misselliev/a-note-about-openssl-error-on-rails-3jaf</link>
      <guid>https://forem.com/misselliev/a-note-about-openssl-error-on-rails-3jaf</guid>
      <description>&lt;p&gt;Last week, everything was fine and dandy. It was a brand new day with lots of code to look forward to when I decided it was time to upgrade my rails version and build an API idea I had been toying with.&lt;/p&gt;

&lt;p&gt;It all went down A-OK until it was time to actually create the project and I got the following error:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qa38hZnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qMswRvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qa38hZnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qMswRvs.png" alt="My Chi Dulce, being completely unamused"&gt;&lt;/a&gt;&lt;/p&gt;
Our reaction to the error was less than amused



&lt;p&gt;After browsing and diving in the interwebs for answers, I boiled it down to two probable issues: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You need to upgrade your OpenSSL.&lt;br&gt;
This one is pretty straightforward, type the following into console:&lt;br&gt;
&lt;code&gt;brew install --upgrade openssl&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's not you, it's me: PostgreSQL edition.&lt;br&gt;
At some point, your configs got a bit tangled up and the PostgreSQL gem is right there in the middle of it all. To make it all better you'll need to reinstall the gem, simply type &lt;code&gt;brew reinstall postgresql&lt;/code&gt;&lt;br&gt;
and you're good to go. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--glc1Fq4o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/zt3l2hP.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--glc1Fq4o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/zt3l2hP.jpg" alt="Chi working zone" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
Dulce, ready to keep working on her code reviews



&lt;p&gt;I hope you found this helpful, happy coding!&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment, meme or dog photos swap.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>codenewbie</category>
      <category>debugging</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Easy as a pie Big O notation. Part 2: Space.</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Tue, 25 Feb 2020 23:30:10 +0000</pubDate>
      <link>https://forem.com/misselliev/easy-as-a-pie-big-o-notation-part-2-space-4on9</link>
      <guid>https://forem.com/misselliev/easy-as-a-pie-big-o-notation-part-2-space-4on9</guid>
      <description>&lt;h3&gt;
  
  
  What?
&lt;/h3&gt;

&lt;p&gt;When talking about space complexity, it's common that we hear the term 'Auxiliary space complexity'. This refers to the space required by the algorithm (not the space taken by inputs). &lt;/p&gt;

&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;While it might be more pressing at some cases to look at time complexity, there will be times when you need to consider the environment in which your code will be executed and whether you will have the resources to do so. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--21P2U7Nd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media1.giphy.com/media/3orieUe6ejxSFxYCXe/giphy.gif%3Fcid%3D790b7611cd38c92499e0197aea868eb3cdcccde74f1b5041%26rid%3Dgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--21P2U7Nd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media1.giphy.com/media/3orieUe6ejxSFxYCXe/giphy.gif%3Fcid%3D790b7611cd38c92499e0197aea868eb3cdcccde74f1b5041%26rid%3Dgiphy.gif" alt="AHA! moment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Important tips to look out for
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Primitives are constant space (booleans, numbers, undefined, null)&lt;/li&gt;
&lt;li&gt;Strings require O(n) space (where n is the string length)&lt;/li&gt;
&lt;li&gt;Reference types are usually O(n) too, where n is either the length for arrays or number of keys for objects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In space complexity, we also use logarithms to express performance. So whenever you see &lt;em&gt;O(log n)&lt;/em&gt; it's safe to say we're talking about space, not time complexity.&lt;/p&gt;

&lt;h3&gt;
  
  
  About logarithms
&lt;/h3&gt;

&lt;p&gt;A logarithm is the inverse of exponentiation. The logarithm of a number roughly measures the number of times you can divide that number by 2 before you get a value that’s less than or equal to one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where can we expect to see logarithms?
&lt;/h3&gt;

&lt;p&gt;Certain searching algorithms have logarithmic time complexity.&lt;br&gt;
Efficient sorting algorithms involve logarithms. &lt;br&gt;
Recursion sometimes might involve logarithmic space complexity.&lt;/p&gt;

&lt;h3&gt;
  
  
  So, where does this leave us?
&lt;/h3&gt;

&lt;p&gt;To sum it up, &lt;br&gt;
-Big O notation is used to analyze algorithm performance.&lt;br&gt;
-It can give us a high level of understanding of the time or space complexity of it.&lt;br&gt;
-It cares about general trends, not details.&lt;br&gt;
-Time or space complexity depends only on the algorithm, not the hardware where it’s running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y7xxQK1g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media2.giphy.com/media/xUOxfecWsLzAYSUP6w/giphy.gif%3Fcid%3D790b76114b7e44a85be76724233f4f6386aa8352179a0b88%26rid%3Dgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y7xxQK1g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media2.giphy.com/media/xUOxfecWsLzAYSUP6w/giphy.gif%3Fcid%3D790b76114b7e44a85be76724233f4f6386aa8352179a0b88%26rid%3Dgiphy.gif" alt="get-it"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment or meme.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>algorithms</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Easy as a pie Big O notation. Part 1: Time.</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Tue, 25 Feb 2020 01:24:06 +0000</pubDate>
      <link>https://forem.com/misselliev/easy-as-a-pie-big-o-notation-part-1-time-3197</link>
      <guid>https://forem.com/misselliev/easy-as-a-pie-big-o-notation-part-1-time-3197</guid>
      <description>&lt;p&gt;In coding, as in life, there's always more than one way to approach problems as long as you're creative enough. But how would you know which one of the bunch is the &lt;strong&gt;best&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Also, keep in mind that the best is a relative term. You define this according to what your needs are. Faster? Less memory use? More readable?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That's when "the Big O notation talk" comes into the picture.&lt;/p&gt;

&lt;h3&gt;
  
  
  What?
&lt;/h3&gt;

&lt;p&gt;Basically, it’s a way of generalizing our code and comparing it and its performance to other pieces of code. With big-O we can talk formally about the runtime of an algorithm as the inputs grow. &lt;br&gt;
It's important to note, that we care about the trends and not details.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;Knowing the big-O of our code allows us to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have a more precise way to talk about performance&lt;/li&gt;
&lt;li&gt;Lets us identify parts of the solution that might be inefficient&lt;/li&gt;
&lt;li&gt;Help us discuss trade-off of several approaches &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How?
&lt;/h3&gt;

&lt;p&gt;We count the number of operations that our functions need to be executed.&lt;/p&gt;

&lt;p&gt;More formally, we can say that algorithm is  &lt;em&gt;O(f(n))&lt;/em&gt;  if the number of simple operations that we have to do is eventually less than a constant time &lt;em&gt;f(n)&lt;/em&gt;  as n increases.&lt;br&gt;
&lt;em&gt;f(n)&lt;/em&gt; means it could be linear, &lt;em&gt;f((n)=n^2 )&lt;/em&gt; means it could be quadratic, or &lt;em&gt;f(n) =1)&lt;/em&gt; means it is constant. &lt;br&gt;
An &lt;em&gt;O(1)&lt;/em&gt; would mean that as n grows, it has no change reflected in runtime. &lt;br&gt;
An &lt;em&gt;O(n)&lt;/em&gt; operation inside of an &lt;em&gt;O(n)&lt;/em&gt; operation equals &lt;em&gt;O(n^2 )&lt;/em&gt;. (Nested loops are a great example of this).&lt;/p&gt;

&lt;p&gt;Regardless of the exact number of operations, they tend to grow roughly proportionally with n. So if n doubles, the number of operations will also roughly double.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can we make it simpler?
&lt;/h3&gt;

&lt;p&gt;There's something important to take into consideration to simplify a big O. At the end of the day, as we said before, we're looking to spot trends and not details. This means we're interested in the big picture, which translates to: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can take out the constants. We’re looking at the big picture so &lt;em&gt;O(2n)&lt;/em&gt; can be translated into &lt;em&gt;O(n)&lt;/em&gt; and &lt;em&gt;0(500)&lt;/em&gt; can be &lt;em&gt;O(1)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Small terms are not important either. Again, think of the big picture. If we have &lt;em&gt;O(n+10)&lt;/em&gt; we can forget about 10 and translate it into &lt;em&gt;O(n)&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Important tips to look out for
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Arithmetic operations are constant&lt;/li&gt;
&lt;li&gt;Variable assignment is constant&lt;/li&gt;
&lt;li&gt;Accessing elements in an array by index or object is also constant&lt;/li&gt;
&lt;li&gt;In a loop, complexity is the length of the loop times the complexity of what’s inside of it&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Which one is best?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P-yvU5qI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gqdikmy892uf1m9gdl2o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P-yvU5qI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gqdikmy892uf1m9gdl2o.png" alt="complexity table"&gt;&lt;/a&gt;&lt;br&gt;
Ideally, we should be striving to get &lt;em&gt;O(1)&lt;/em&gt;, &lt;em&gt;O(log n)&lt;/em&gt; or &lt;em&gt;O(n)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;O(log n)&lt;/em&gt; refers to space complexity, which will be addressed in the second part of this article series.&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment or meme.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Get hooked on Hooks.</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Mon, 24 Feb 2020 20:41:52 +0000</pubDate>
      <link>https://forem.com/misselliev/get-hooked-on-hooks-2ob9</link>
      <guid>https://forem.com/misselliev/get-hooked-on-hooks-2ob9</guid>
      <description>&lt;p&gt;When I was just entering the React-Redux world, the concept of hooks seemed daunting. &lt;em&gt;so I have to learn React AND Hooks to know React?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/hrRJ41JB2zlgZiYcCw/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/hrRJ41JB2zlgZiYcCw/giphy.gif" alt="frustrated monkey on a laptop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's easy to get overwhelmed when you're not quite sure if your knowledge of vanilla JS will be enough to understand React and Redux, but Hooks are easier than they seem at first glance.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://react-redux.js.org/next/api/hooks"&gt;official documentation&lt;/a&gt;,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;React's new "hooks" APIs give function components the ability to use local component state, execute side effects, and more.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What this means is that you can now favor using Hooks instead of functions like connect() or mapDispatchToProps(). We are able to do this because we are accessing the state directly, we no longer need aids to do so.&lt;/p&gt;

&lt;h1&gt;
  
  
  Quick start on hooks
&lt;/h1&gt;

&lt;p&gt;We'll be talking about useSelector() and useDispatch() in order to replace connect(), mapDispatchToProps() and mapStateToProps().&lt;/p&gt;

&lt;h5&gt;
  
  
  useSelector()
&lt;/h5&gt;

&lt;p&gt;This is the equivalent of mapStateToProps. It takes a pure function as an argument that lets it know which part of the state you want to access.&lt;/p&gt;

&lt;p&gt;It's also important to note that we're passing a second argument called shallowEqual. By doing this, we are letting it know that it has to use a shallow equality comparison.&lt;/p&gt;

&lt;p&gt;You could also opt-out of adding it but rendering is always going to be more expensive than a quick selector check and returning new references will cause unnecessary re-renders whenever we dispatch any actions.&lt;/p&gt;

&lt;h5&gt;
  
  
  useDispatch()
&lt;/h5&gt;

&lt;p&gt;This is the better version of mapDispatchToProps. To use it, we first need to invoke useDispatch into a variable and store it. After that, we're free to manually dispatch any redux action we have defined.&lt;/p&gt;

&lt;p&gt;Using both of these hooks will discard the need for Redux's connect since we are pulling and dispatching directly.&lt;/p&gt;

&lt;h1&gt;
  
  
  But how does it look like?
&lt;/h1&gt;

&lt;p&gt;Given this quick snippet of a bookList component, we will transform from the traditional connect into hooks.&lt;/p&gt;

&lt;h5&gt;
  
  
  Using connect
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h5&gt;
  
  
  Refactoring using hooks
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
 

&lt;p&gt;What did you learn today?&lt;br&gt;
&lt;a href="https://i.giphy.com/media/LmNwrBhejkK9EFP504/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/LmNwrBhejkK9EFP504/giphy.gif" alt="kitty coding master"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Got something to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev"&gt;reach out&lt;/a&gt; for any question, comment or meme.&lt;/p&gt;

</description>
      <category>react</category>
      <category>hooks</category>
      <category>redux</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Your quick #a11y cheat sheet</title>
      <dc:creator>Elizabeth Villalejos</dc:creator>
      <pubDate>Wed, 17 Jul 2019 20:44:20 +0000</pubDate>
      <link>https://forem.com/misselliev/your-quick-a11y-cheat-sheet-30ko</link>
      <guid>https://forem.com/misselliev/your-quick-a11y-cheat-sheet-30ko</guid>
      <description>&lt;p&gt;Recently, in one of those Youtube dives everyone gets in every now and then, I stumbled upon an old &lt;a href="https://www.youtube.com/watch?time_continue=102&amp;amp;v=XB4cjbYywqg" rel="noopener noreferrer"&gt;Apple comercial&lt;/a&gt; about accessibility and it struck a chord in ways I hadn't even considered before.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Get over it — accessibility is not optional”.- Jenny Lay-Flurrie, Chief Accessibility Officer at Microsoft.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When starting your coding path and diving into basic website making, there's not a lot of content about how to make your website a11y friendly in these stages when you're not really sure what to look for, what to learn first and you're mainly worrying about why your css is not linking correctly. &lt;em&gt;(Guilty as charged)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So, what does web accessibility even means?
&lt;/h2&gt;

&lt;p&gt;W3C defines Web accessibility as websites, tools, and technologies are designed and developed so that people with disabilities can use them. &lt;/p&gt;

&lt;p&gt;What kind of conditions do you need to take in consideration?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual: partial or total inability to see or perceive colors.&lt;/li&gt;
&lt;li&gt;Motor skills: making precise movements is hard (using a mouse)&lt;/li&gt;
&lt;li&gt;Hearing: reduced or non-existing ability to hear.&lt;/li&gt;
&lt;li&gt;Photosensitive seizures: Flashing lights in animations can trigger epilepsy episodes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why is it important?
&lt;/h2&gt;

&lt;p&gt;By doing some small tweaks on your code, you'll be able to make the user experience as equally as possible so every person will be able to interact, understand, navigate, contribute to the web no matter their circumstances or abilities.&lt;/p&gt;

&lt;p&gt;You can help someone feel welcome and included, wouldn't that be great?&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdzs9suju3zi6wzj58op5.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdzs9suju3zi6wzj58op5.jpeg" title="happy coding people" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not only people with disabilities would be benefitted from this. Web accessibility is used by people using mobile devices or slow network connections. Also, this overlaps with good code practices (yay!)&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips you can implement now
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Add Alt text to images&lt;br&gt;
Captions are great but in case your image were not to be loaded, how would the user know what it's looking at?&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1sxhrf98pu0cmrdfkimi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1sxhrf98pu0cmrdfkimi.jpg" title="alt text example" alt="alt text"&gt;&lt;/a&gt;&lt;br&gt;
Screen readers also benefit from it. &lt;br&gt;
Bonus: alt text can also improve your SEO! Make sure to write descriptively and use keywords that make sense. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be smart with your colors&lt;br&gt;
Red background and green text isn't the greatest choice out there. The contrast you use are important to how much of your page can actually be seen and understood. You can do a quick check up for your color scheme &lt;a href="https://contrastchecker.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use headers in your favor&lt;br&gt;
Give your website a correct flow and structure with the right header tag. As a recommendation, only your main title should go with H1 and then use your subheaders accordingly to their importance or relevance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use title tag&lt;br&gt;
It's very helpful for screen readers and helps structure your content. Use a short title that tells what your site is about.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1pkbuql80gty7tqdkf5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1pkbuql80gty7tqdkf5y.png" title="title-header-example" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Labels can still be cool&lt;br&gt;
While placeholders look very good on forms instead of labels, in some screen readers they're ignored so the user reaches a text field that has no description. I'm not telling you to stop using them (I have a soft spot for them) but to include a label even if it's hidden for this purpose. Make sure the label and placeholder have the same text.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be friends with Aria-label attribute&lt;br&gt;
Accessible Rich Internet Applications (ARIA) is a set of HTML attributes that define ways to make Web content and Web applications more accessible to people with disabilities. You can look into more info on how to use it &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is my website a11y friendly?
&lt;/h2&gt;

&lt;p&gt;You can check how your website rates in accessibility (speed, security and more) over &lt;a href="https://webhint.io/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Got anymore to add? Please feel free to &lt;a href="https://twitter.com/miss_elliev" rel="noopener noreferrer"&gt;reach out&lt;/a&gt; for any question, comment or meme.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>html</category>
    </item>
  </channel>
</rss>
