<?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: Taylor Sieling</title>
    <description>The latest articles on DEV Community by Taylor Sieling (@taylorsieling).</description>
    <link>https://dev.to/taylorsieling</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%2F613137%2F4384676a-744f-4e67-a4b3-170ec5774b85.png</url>
      <title>DEV Community: Taylor Sieling</title>
      <link>https://dev.to/taylorsieling</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/taylorsieling"/>
    <language>en</language>
    <item>
      <title>To Do: Learn Vue</title>
      <dc:creator>Taylor Sieling</dc:creator>
      <pubDate>Fri, 10 Sep 2021 03:23:50 +0000</pubDate>
      <link>https://dev.to/taylorsieling/to-do-learn-vue-4kgj</link>
      <guid>https://dev.to/taylorsieling/to-do-learn-vue-4kgj</guid>
      <description>&lt;p&gt;To dip my toes into the ocean of Vue, I created a super simple, backend-less application. Here is a bit about my journey:&lt;/p&gt;

&lt;h4&gt;
  
  
  Setting Up Vue
&lt;/h4&gt;

&lt;p&gt;I started by creating an index.html file and added the Vue.js script provided in the &lt;a href="https://vuejs.org/v2/guide/"&gt;Getting Started&lt;/a&gt; documentation. I decided to stick with this quick and easy "installation" as I was just starting out with the framework. However, I look forward to using NPM and CLI in the future. &lt;/p&gt;

&lt;h4&gt;
  
  
  Creating a Vue Instance
&lt;/h4&gt;

&lt;p&gt;As stated in the &lt;a href="https://vuejs.org/v2/guide/instance.html"&gt;documentation&lt;/a&gt;, "every Vue application starts by creating a new Vue instance with the Vue function". Mine looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const app = new Vue({

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to tell Vue where to live on the page, I added an 'el' property to my Vue object and assigned it to the ID #app. In my index.html file, I created a main tag with an ID of app - and I was ready to roll!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.js

const app = new Vue({
 el: '#app'
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;index.html

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
 &amp;lt;head&amp;gt;
    //head stuff
 &amp;lt;/head&amp;gt;
 &amp;lt;body class="bg-black"&amp;gt;
    &amp;lt;main id="app"&amp;gt;
    &amp;lt;/main&amp;gt;
    &amp;lt;script src="https://cdn.jsdelivr.net/npm/vue@2". 
    &amp;lt;/script&amp;gt;
    &amp;lt;script src="app.js" charset="utf-8"&amp;gt;&amp;lt;/script&amp;gt;
 &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  The To Do Form
&lt;/h4&gt;

&lt;p&gt;To start on my To Do App, I needed a To Do form. I won't get too into the HTML of it all, but I really enjoyed how Vue let me write more straight-forward HTML rather than JSX. I created a form, with a To Do input field and a Submit button.&lt;/p&gt;

&lt;p&gt;To call a Vue function when the form is submitted, I used the &lt;code&gt;v-on&lt;/code&gt; shorthand &lt;code&gt;@submit.prevent&lt;/code&gt; and set it equal to a function called &lt;code&gt;addTodo&lt;/code&gt;. &lt;code&gt;.prevent&lt;/code&gt; is a handy Vue modifier that tells the &lt;code&gt;v-on&lt;/code&gt; directive to call event.preventDefault() on the triggered event.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;index.html

&amp;lt;form @submit.prevent="addTodo"&amp;gt;
   &amp;lt;div class="subtitle"&amp;gt;&amp;lt;label for="newTodo"&amp;gt;Add Task&amp;lt;/label&amp;gt;&amp;lt;/div&amp;gt;
   &amp;lt;input v-model="newTodo" class="input" type="type" name="newTodo" id="newTodo"&amp;gt;
   &amp;lt;button type="submit" name="button"&amp;gt;+&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create the function, I added a methods object to my Vue instance and wrote a function called &lt;code&gt;addTodo&lt;/code&gt;. To use the function, I needed to store the user input into a Vue data object. I created an attribute called &lt;code&gt;newTodo&lt;/code&gt; and set it equal to an empty string, as well as an attribute called &lt;code&gt;todos&lt;/code&gt; set to an empty array. &lt;/p&gt;

&lt;p&gt;Now, I could store the title of my To Do input and push it to my Todos array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const app = new Vue({
    el: '#app',
    data: {
        title: 'Getting Stuff Done',
        newTodo: '',
        todos: [],
    },
    methods: {
        addTodo() {
            console.log(this.newTodo);
            this.todos.push({
                title: this.newTodo,
            });
            this.newTodo = '';
        },
    }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;v-model&lt;/code&gt; attribute on my input tag allowed me to link the user input to the Vue data object. As stated in the &lt;a href="https://vuejs.org/v2/guide/instance.html#Data-and-Methods"&gt;documentation&lt;/a&gt;, "When a Vue instance is created, it adds all the properties found in its data object to Vue’s reactivity system. When the values of those properties change, the view will “react”, updating to match the new values."&lt;/p&gt;

&lt;h4&gt;
  
  
  Displaying the To Do List
&lt;/h4&gt;

&lt;p&gt;Of course, after submitting a To Do item, you want the item to display on the page. With the use of "Mustache" syntax, I did some simple text interpolation to create my list. The &lt;code&gt;v-for&lt;/code&gt; directive on the list item is used to render the element or template block multiple times based on the source data. So, for each todo in my todos array, a new list item is created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;index.html

&amp;lt;ul&amp;gt;
  &amp;lt;li v-for="todo in todos"&amp;gt;
    &amp;lt;input type="checkbox" v-model="todo.done"&amp;gt;
    &amp;lt;span :class="{ done: todo.done }"&amp;gt;{{todo.title}}&amp;lt;/span&amp;gt;
    &amp;lt;button @click="removeTodo(todo)" type="button" 
     name="remove"&amp;gt;Remove&amp;lt;/button&amp;gt;
  &amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also went ahead and added a checkbox to indicate when a task has been completed. This process involved giving my &lt;code&gt;newTodo&lt;/code&gt; a 'done' attribute initially set to false, creating a checkbox with a &lt;code&gt;v-model&lt;/code&gt; of 'todo.done', and setting my CSS to strikeout items when &lt;code&gt;todo.done&lt;/code&gt; is true.&lt;/p&gt;

&lt;h4&gt;
  
  
  Removing Todo Items
&lt;/h4&gt;

&lt;p&gt;I wanted my app to have the option to remove Todo items. I started by adding a 'Remove' button to each Todo list item, as seen above. I used the &lt;code&gt;v-on&lt;/code&gt; shorthand &lt;code&gt;@click&lt;/code&gt; and set it equal to a function called &lt;code&gt;removeTodo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Just like with &lt;code&gt;addTodo&lt;/code&gt;, I created a &lt;code&gt;removeTodo&lt;/code&gt; function in my Vue methods object and removed individual Todos using the &lt;code&gt;.splice&lt;/code&gt; method. &lt;/p&gt;

&lt;h4&gt;
  
  
  Completing All Todo Items
&lt;/h4&gt;

&lt;p&gt;Lastly, I wanted the ability to mark all Todos from the list as complete at once. I mean, everyone loves that feeling, right? &lt;/p&gt;

&lt;p&gt;Just like with my &lt;code&gt;removeTodo&lt;/code&gt; function, I created a button, set it equal to an &lt;code&gt;allDone&lt;/code&gt; function, and wrote the function in my Vue methods object. With a simple forEach loop, I set &lt;code&gt;todo.done&lt;/code&gt; to true for all of my todos. &lt;/p&gt;

&lt;h4&gt;
  
  
  Reflection
&lt;/h4&gt;

&lt;p&gt;Although this app is really simple, I really enjoyed playing around in Vue. I was surprised at just how easy it was to catch on to its syntaxes and functionality. I have a lot more research to do and many more apps to build, but I can definitely see myself falling in love with Vue as a framework.&lt;/p&gt;

&lt;p&gt;Thanks for following on my journey into the world of Vue! You can find the &lt;a href="https://github.com/taylorsieling/to-do-vue"&gt;Repo&lt;/a&gt; on my &lt;a href="https://github.com/taylorsieling"&gt;Github&lt;/a&gt;, as well as a &lt;a href="https://taylorsieling.dev/to-do-vue/"&gt;demo of the app here.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Palindrome Algorithm: Working Through A Mock Technical Interview</title>
      <dc:creator>Taylor Sieling</dc:creator>
      <pubDate>Sat, 28 Aug 2021 21:53:50 +0000</pubDate>
      <link>https://dev.to/taylorsieling/the-palindrome-algorithm-working-through-a-mock-technical-interview-3efb</link>
      <guid>https://dev.to/taylorsieling/the-palindrome-algorithm-working-through-a-mock-technical-interview-3efb</guid>
      <description>&lt;p&gt;A week and a half ago, I had a mock technical interview. It was my first technical interview ever, excluding my project reviews at Flatiron School. I was very nervous.&lt;/p&gt;

&lt;p&gt;During the interview, I was asked to solve an algorithm: Given a string, check if the characters of the given string can be rearranged to form a palindrome. &lt;/p&gt;

&lt;p&gt;I was immediately mad at myself upon hearing the question. Just that week I had attended an Algorithm Workshop and was told to look out for palindromes in particular. I kept telling myself to sit down and study them, but never got around to it. And there I was, frozen and staring at my screen.&lt;/p&gt;

&lt;p&gt;I was able to pull myself together and worked through most of the logic of the question, but struggled with applying the code in vanilla Javascript. With some really helpful tips from my interviewer, I ended up working through the problem as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function isPalindrome(str) {
 //some code goes here
}

console.log(isPalindrome('civic')); // civic =&amp;gt; true
console.log(isPalindrome('civil')); // civil =&amp;gt; false
console.log(isPalindrome('level')); // level =&amp;gt; true
console.log(isPalindrome('sees')); // sees =&amp;gt; true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My first thought was to split the string so that I could work with individual letters, something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function isPalindrome(str) {
 let chars = str.split("")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I had to think quite a bit about what those split letters needed to do. My interviewer asked me some great prompting questions which led me to the realization that I didn't need to split them at all. &lt;/p&gt;

&lt;p&gt;When it comes down to it, palindromes are just words that have, at most, one character with an odd number of occurrences. All other letters have to appear an even amount of times.&lt;/p&gt;

&lt;p&gt;With that, I set out to create an object that counted how many times each letter appeared in a word.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function isPalindrome(str) {

  let count = {}
  for (let i = 0; i &amp;lt; str.length; i++) {
    let letter = str[i];
        !count[letter] ? count[letter] = 1 : count[letter]++;
  }

 return count

}

console.log(isPalindrome('civic')); // { c: 2, i: 2, v: 1 }
console.log(isPalindrome('civil')); // { c: 1, i: 2, v: 1, l: 1 }
console.log(isPalindrome('level')); // { a: 2, b: 2, c: 2, d: 1 }
console.log(isPalindrome('sees')); // { s: 2, e: 2 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sweet! Now I knew how many times each letter appeared in a string. All I had to do was check that only one letter, if any, had an odd count. &lt;/p&gt;

&lt;p&gt;This was the part where the code itself stumped me. I understood what needed to happen, but not how to write the code. My interviewer was incredibly helpful. I pseudo-coded the rest of the function and he helped me translate it into Javascript.&lt;/p&gt;

&lt;p&gt;The first step: Get an array of values for each letter by using &lt;code&gt;Object.values(count)&lt;/code&gt;. Then, set a variable to track how many odd values are in the array. I used a second for loop and the remainder operator to increase &lt;code&gt;oddCounts&lt;/code&gt; when a letter count was not divisible by 2.&lt;/p&gt;

&lt;p&gt;Lastly, I set the function to return false if the &lt;code&gt;oddCounts&lt;/code&gt; was greater than 1.&lt;/p&gt;

&lt;p&gt;And voilà:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function isPalindrome(str) {

  let count = {}
  for (let i = 0; i &amp;lt; str.length; i++) {
    let letter = str[i];
        !count[letter] ? count[letter] = 1 : count[letter]++;
  }

  let counts = Object.values(count)
  let oddCounts = 0; 
    for (let i = 0; i &amp;lt; counts.length; i++) { 
        if (counts[i] % 2 != 0) { 
            oddCounts++;
        }

        if (oddCounts &amp;gt; 1) { 
            return false;
        }
    }
  return true; 
}

console.log(isPalindrome('civic')); // civic =&amp;gt; true
console.log(isPalindrome('civil')); // civil =&amp;gt; false
console.log(isPalindrome('level')); // level =&amp;gt; true
console.log(isPalindrome('sees')); // sees =&amp;gt; true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I learned a lot from my mock technical interview and I'm so glad that I was afforded the opportunity have one. I feel as though I am very strong when it comes to talking about code, but have a difficult time thinking through coding during the live challenges. &lt;/p&gt;

&lt;p&gt;With the experience in my back pocket, I know to practice my algorithms, brush up on some basic Javascript concepts, and not let Aibohphobia* get me down. &lt;/p&gt;

&lt;p&gt;*The unofficial word for 'fear of palindromes', tehe.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>algorithms</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Full-Time Job, Part-Time Student: How I Managed My Time During Bootcamp</title>
      <dc:creator>Taylor Sieling</dc:creator>
      <pubDate>Tue, 15 Jun 2021 20:34:01 +0000</pubDate>
      <link>https://dev.to/taylorsieling/full-time-job-part-time-student-how-i-managed-my-time-during-bootcamp-3bdb</link>
      <guid>https://dev.to/taylorsieling/full-time-job-part-time-student-how-i-managed-my-time-during-bootcamp-3bdb</guid>
      <description>&lt;h1&gt;
  
  
  The End of an Era
&lt;/h1&gt;

&lt;p&gt;I am coming to the close of my ten-month long bootcamp at Flatiron School. The experience was a roller-coaster: there were days when I felt on top of the world, itching to get my fingers on the keyboard. And, there were days where I felt low and frustrated with debugging and debugging and debugging. But, if you know anything about me, you know that I absolutely love a good roller-coaster.&lt;/p&gt;

&lt;p&gt;Like many other bootcamp students, I worked full-time during the day and coded part-time at home in the evenings and on the weekends. My success thus far has really come down to managing my time and finding that sweet balance between work, school, and relaxation. Here are my top five tips for doing just that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write it Down
&lt;/h2&gt;

&lt;p&gt;Flatiron School did a wonderful job of helping its students keep on pace during the program. Each week, my cohort lead would post our schedule in our Slack channel - breaking down which lessons and labs to complete each day. Now, if you are like me, the schedule didn't always align with my work schedule. So, I made my own! &lt;/p&gt;

&lt;p&gt;On Mondays, I wrote out which lessons and labs I aimed to complete each day taking into account my work schedule and personal plans. I put heavier coursework loads on my lighter work days. For example: If I knew I had a busy Wednesday, I would shift the bulk of my work to Friday when I had more time in the evening to dedicate to coding. This method may seem obvious, but writing it down in advance helped me tremendously in keeping up the pace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YGQMVUJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4eub40s4j56gl77cql0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YGQMVUJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4eub40s4j56gl77cql0.jpg" alt="IMG_6374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Give Yourself A Day for Catch-Up
&lt;/h2&gt;

&lt;p&gt;Learning code can be hard - especially when you are learning a lot of material very quickly. Sometimes, certain labs or concepts would take me longer to complete than I had originally planned for. A few months into the bootcamp, I started giving myself an extra day in my planned out schedule for catch-up. Having dedicated time to getting back on track allowed me to take more time on difficult concepts and overall helped to reduce my stress.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X2VZuZkL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpmox834s2t0sapwmqdn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X2VZuZkL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpmox834s2t0sapwmqdn.jpg" alt="IMG_6367 3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Ahead When You Can
&lt;/h2&gt;

&lt;p&gt;On the flip-side of my last tip... get ahead when you can! When I would finish all of the lessons and labs I had planned for the day but still had time set aside for schoolwork, I moved onto the next section. I found that getting ahead during my scheduled time helped to balance out the longer lessons and gave me more free time at the end of the week for hobbies and relaxation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZEpumGdI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0duswvenu3bzeydiy4e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZEpumGdI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0duswvenu3bzeydiy4e.jpg" alt="IMG_6377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Rearrange The Lessons if Needed
&lt;/h2&gt;

&lt;p&gt;The Flatiron coursework is broken down in READMEs (lessons) and labs. Not surprisingly, the lessons usually took less time than the labs, even when I was taking detailed notes. On top of that, I could read through lessons and take notes almost anywhere, whereas I preferred to be at my desk to focus on the code alongs and labs. &lt;/p&gt;

&lt;p&gt;All of that to say, there were weeks when I would complete the READMEs and take all of my notes before starting on the actual coding. I could login to my account on my lunch break at work and get through my lessons and note-taking during the week, then I could complete all of my coding practice at home over the weekend. I tried not to move onto the next section or topic before completing the labs, but I found that shifting the order within a section helped me to better balance my time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7rMxLIcf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9u80cy1aoenieuz0etoz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7rMxLIcf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9u80cy1aoenieuz0etoz.png" alt="Screen Shot 2021-06-15 at 3.19.11 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Plan Your Projects First
&lt;/h2&gt;

&lt;p&gt;I loved everything about my Flatiron bootcamp... so much that come project time, I wanted to just dive right into the coding. Usually, that would lead to me coding out entire components that I didn't end up using in my final project and wasting a lot of valuable time. If you keep on pace with the lessons and labs, you have two weeks to complete your end-of-module projects. If you are ambitious in your code, that doesn't give you a lot of time. &lt;/p&gt;

&lt;p&gt;My advice: Plan out your project first! Write out your concept, draw up some wireframes, define your associations, etc. Of course, your project may evolve as you work on it. But having a good outline will really help you to stay on task and manage that precious project time. &lt;/p&gt;

&lt;p&gt;I also found that finalizing my project concept a few weeks in advance really helped when it came time to code. Not only did it give me more planning time, but I was able to relate the lessons and labs directly to what I would be coding in my project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XYu82OCT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zi4z40a85qx31gqicaiq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XYu82OCT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zi4z40a85qx31gqicaiq.jpg" alt="IMG_6385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Tip
&lt;/h2&gt;

&lt;p&gt;Attend the lectures! This may sound like a no-brainer, but I think my cohort leader's lectures were the most valuable part of my bootcamp experience. Watching her code in real-time and being able to ask live questions really made the concepts sink in for me. I realize that schedules are busy and not everyone has time to attend "class". But if you can make time, I highly recommend tuning in those two nights a week!&lt;/p&gt;

</description>
      <category>student</category>
      <category>timemanagement</category>
      <category>flatiron</category>
      <category>bootcamp</category>
    </item>
    <item>
      <title>React(.js)ing to My New Foster Kittens: A React/Redux Application</title>
      <dc:creator>Taylor Sieling</dc:creator>
      <pubDate>Mon, 07 Jun 2021 21:54:04 +0000</pubDate>
      <link>https://dev.to/taylorsieling/react-js-ing-to-my-new-foster-kittens-a-react-redux-application-13ng</link>
      <guid>https://dev.to/taylorsieling/react-js-ing-to-my-new-foster-kittens-a-react-redux-application-13ng</guid>
      <description>&lt;h3&gt;
  
  
  The Project
&lt;/h3&gt;

&lt;p&gt;All of my Flatiron School projects have related to my interests and passions, and my React.js project is probably closest to my heart. I have recently started fostering kittens through my local Humane Society, and as such built an application to manage kitten intakes and updates. Users can input all pertinent intake information when getting new fosters, and edit/delete the information as necessary.  &lt;/p&gt;

&lt;h3&gt;
  
  
  The Structure
&lt;/h3&gt;

&lt;h5&gt;
  
  
  Routes
&lt;/h5&gt;

&lt;p&gt;/&lt;br&gt;
/kittens&lt;br&gt;
/kittens/:id&lt;br&gt;
/kittens/:id/edit&lt;br&gt;
/kittens/intake&lt;/p&gt;
&lt;h5&gt;
  
  
  Presentational Components
&lt;/h5&gt;

&lt;p&gt;Home.js&lt;br&gt;
Navigation.js&lt;br&gt;
Footer.js&lt;br&gt;
KittenCard.js - for the Kitten Index page&lt;br&gt;
KittenShow.js - for the Kitten Show page&lt;/p&gt;
&lt;h5&gt;
  
  
  Container Components
&lt;/h5&gt;

&lt;p&gt;Kittens.js - for the Kitten Index page&lt;br&gt;
KittenContainer.js - for the Kitten Show page&lt;br&gt;
IntakeForm.js - new Kitten form&lt;br&gt;
EditForm.js - edit Kitten form&lt;/p&gt;
&lt;h3&gt;
  
  
  The Rails API Backend
&lt;/h3&gt;

&lt;p&gt;I set up my Model and Controller using the Rails resource generator. I created my seeds, enabled CORS, and set-up my JSON serializer. &lt;/p&gt;
&lt;h3&gt;
  
  
  The React.js Frontend
&lt;/h3&gt;

&lt;p&gt;I used &lt;code&gt;create-react-app&lt;/code&gt; to get started with my frontend. I set-up my folders for Containers, Components, Actions, and Reducers. &lt;/p&gt;
&lt;h5&gt;
  
  
  Using Redux
&lt;/h5&gt;

&lt;p&gt;Although React Hooks are replacing Redux, I appreciated getting to learn the Redux pattern. Redux lets you create a store to hold your state. The store can dispatch an action to the appropriate reducer and create an object to make changes to the state. Components are then able to re-render on the DOM with the new data.&lt;/p&gt;

&lt;p&gt;I used my Redux store to hold information about my kittens, which could be passed to my Presentational Components. My Presentational Components are stateless and accept props mapped from their Container Component's state. I used Functional Components within my Presentation Components. &lt;/p&gt;

&lt;p&gt;My Container Components, which needed access to my Redux store and certain Lifecycle Methods, were build using Class Components.&lt;/p&gt;
&lt;h3&gt;
  
  
  Redux-Thunk Middleware
&lt;/h3&gt;

&lt;p&gt;Javascript web requests are asynchronous, meaning our fetch requests can run into an issue where our action creator returns an action before the API data is actually fetched.&lt;/p&gt;

&lt;p&gt;The Thunk middleware allows us to return a function inside of the action creator, rather than a Javascript object. That function can dispatch multiple actions, depending on whether the loading state is true or false.&lt;/p&gt;

&lt;p&gt;Here is an example of the Redux-Thunk middleware in action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/containers/KittenContainer.js

class KittenContainer extends Component {

    componentDidMount() {
        this.props.fetchKittens();
    }

    ...

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I call my &lt;code&gt;fetchKittens()&lt;/code&gt; method in my &lt;code&gt;componentDidMount()&lt;/code&gt; lifecycle method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/actions/kittens.js

export const fetchKittens = () =&amp;gt; {

    return (dispatch) =&amp;gt; {
        dispatch({ type: "LOADING_KITTENS"})
        fetch('http://localhost:3001/kittens')
        .then(res =&amp;gt; res.json())
        .then(kittens =&amp;gt; {
            console.log('fetching kittens')
            dispatch({
            type: "KITTENS_LOADED", 
            payload: kittens
        })
        })
    }

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I pass the dispatch method (from the store) into my returned function, and call dispatch twice in the function's body. The first dispatch indicates that I am loading the kitten data from my API. The second dispatch makes the actual GET request to the server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/reducers/kittenReducer.js

const kittens = (state = { kittens: [], loading: false}, action) =&amp;gt; {
    switch(action.type){
        case "LOADING_KITTENS":
            return {
                ...state,
                loading: true
            }
        case "KITTENS_LOADED":
            return {
                ...state, 
                kittens: action.payload,
                loading: false
            }

    ...

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you can see my case switches in my &lt;code&gt;kittenReducer.js&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/containers/KittenContainer.js 

    handleLoading = () =&amp;gt; {
        if (this.props.loading) {
            return (
                &amp;lt;div&amp;gt;
                    &amp;lt;div className="kittens"&amp;gt;
                        &amp;lt;div className="home-text"&amp;gt;
                            &amp;lt;h1&amp;gt;Knittin' Kitten Foster&amp;lt;/h1&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                    &amp;lt;div&amp;gt;&amp;lt;h2&amp;gt;Grabbing the precious baby... one moment please!&amp;lt;/h2&amp;gt;&amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            )
        } else {
            const kitten = this.props.kittens.find(kit =&amp;gt; kit.id === parseInt(this.props.match.params.id))
            return (
                &amp;lt;&amp;gt;
                &amp;lt;div className="kittens"&amp;gt;
                    &amp;lt;div className="home-text"&amp;gt;
                        &amp;lt;h1&amp;gt;{kitten.name}&amp;lt;/h1&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
                &amp;lt;KittenShow kitten={kitten} handleDeleteClick={this.handleDelete}/&amp;gt;
                &amp;lt;/&amp;gt;
            )
        }
    }


    render() {
        return (
            &amp;lt;div&amp;gt;
                {this.handleLoading()}
            &amp;lt;/div&amp;gt;
        )
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Back in my &lt;code&gt;KittenContainer.js&lt;/code&gt;, I wrote a method called &lt;code&gt;handleLoading()&lt;/code&gt; which gives the user a loading message while the kittens are being fetched from the server. &lt;/p&gt;

&lt;h3&gt;
  
  
  In Conclusion
&lt;/h3&gt;

&lt;p&gt;This project saw many iterations in my head. There is still a lot more that I would like to implement in the future - such as authorization for user accounts, an adoption application for community members to apply to adopt specific kittens, etc.&lt;/p&gt;

&lt;p&gt;I have really enjoyed learning React and hope to find a job as a front-end developer in the future.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>javascript</category>
      <category>flatiron</category>
    </item>
    <item>
      <title>Floating "Undefineds" When You Just Want to Care for your Plants.</title>
      <dc:creator>Taylor Sieling</dc:creator>
      <pubDate>Wed, 14 Apr 2021 02:04:04 +0000</pubDate>
      <link>https://dev.to/taylorsieling/floating-undefineds-when-you-just-want-to-care-for-your-plants-2a9n</link>
      <guid>https://dev.to/taylorsieling/floating-undefineds-when-you-just-want-to-care-for-your-plants-2a9n</guid>
      <description>&lt;h4&gt;
  
  
  Ah, Javascript.
&lt;/h4&gt;

&lt;p&gt;I had been looking forward to learning Javascript since the very beginning of my Flatiron School journey. Going into Software Engineering, I knew that I liked frontend development and I was ready dive in. &lt;/p&gt;

&lt;p&gt;The learning curve was very steep. Switching from Ruby brain to Javascript brain was not an easy transition for me. Although I kept up with the lessons and labs throughout the module, I didn't really start to put all the pieces together until I started on my project. The whole time, I just wanted to add my plants, and track their care, and make it all look pretty. But, I kept getting stuck on return values.&lt;/p&gt;

&lt;p&gt;While coding out the plant "show" view of my application, I noticed a floating "undefined" at the bottom of the page. It wasn't coded in the HTML and I spent hours trying to make it go away. Turns out it was from my &lt;code&gt;plantShowRender()&lt;/code&gt; function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    plantShowRender() {
        this.plantIndex.style.display = 'none';
        this.plantShow.style.display = 'block';
        this.plantShow.innerHTML = `
            &amp;lt;div class="section" id="top-button"&amp;gt;
                &amp;lt;button id="back-to-index" class="button"&amp;gt;Back to All Plants&amp;lt;/button&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div class="plant-row" id="plant-info-row"&amp;gt;
                &amp;lt;div class="plant-col" id="plant-${this.id}-image"&amp;gt;
                    &amp;lt;img class="displayimg" src="${this.image_url}" alt="${this.species}" width="100%"&amp;gt;  
                &amp;lt;/div&amp;gt;
                &amp;lt;div class="plant-col" id="plant-${this.id}-care-info"&amp;gt;
                    &amp;lt;h2&amp;gt;${this.nickname}&amp;lt;/h2&amp;gt;
                    &amp;lt;h3&amp;gt;${this.species}&amp;lt;/h3&amp;gt;
                    &amp;lt;p&amp;gt;${this.description}&amp;lt;/p&amp;gt;
                    &amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Current Planter:&amp;lt;/strong&amp;gt; ${this.pot}&amp;lt;/p&amp;gt;
                    &amp;lt;div id="plant-edit-buttons"&amp;gt;
                        &amp;lt;button class="update button" data-id="${this.id}"&amp;gt;Update&amp;lt;/button&amp;gt; 
                        &amp;lt;button class="delete button" data-id="${this.id}"&amp;gt;Delete&amp;lt;/button&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="section" id="plant-care-row"&amp;gt;
                &amp;lt;div class="section" id="care-button-container"&amp;gt;
                    &amp;lt;button id="care-button" class="give-care button" data-id="${this.id}"&amp;gt;Give Plant Care&amp;lt;/button&amp;gt;
                &amp;lt;/div&amp;gt;
                &amp;lt;div class="care-title"&amp;gt;
                    &amp;lt;h2&amp;gt;Plant Care History&amp;lt;/h2&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;`

        this.addPlantCares();
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above was my original code. &lt;/p&gt;

&lt;p&gt;As I have learned, the value of your return will replace the function call. When I called &lt;code&gt;plantsShowRender()&lt;/code&gt;, the return value was "undefined".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; viewPlantInfo = (e) =&amp;gt; {
        const plant = Plant.all.find(p =&amp;gt; p.id == e.target.dataset.id)
        this.plantShow.append(plant.plantShowRender())
        this.addButtonListeners()
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thus, the little floating "undefined" at the bottom of the page. &lt;/p&gt;

&lt;p&gt;I updated my code to add a return statement to &lt;code&gt;plantShowRender()&lt;/code&gt;, as seen here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    plantShowRender() {
        this.plantIndex.style.display = 'none';
        this.plantShow.style.display = 'block';
        this.showElement.innerHTML = `
            &amp;lt;div class="section" id="top-button"&amp;gt;
                &amp;lt;button id="back-to-index" class="button"&amp;gt;Back to All Plants&amp;lt;/button&amp;gt;
            &amp;lt;/div&amp;gt;
                &amp;lt;div class="care-title"&amp;gt;
                    &amp;lt;h2&amp;gt;Plant Care History&amp;lt;/h2&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;`;

        return this.showElement
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, I called the function on &lt;code&gt;this&lt;/code&gt; - the plant instance in this case - and called &lt;code&gt;this.addPlantCares&lt;/code&gt; in the &lt;code&gt;viewPlantInfo()&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;Return values certainly aren't thing only thing that I struggled with in this project, but the more I messed up, the more I learned. In the end, I am really proud of what I created and look forward to working on more frontend projects. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>student</category>
      <category>flatiron</category>
      <category>rubyapi</category>
    </item>
  </channel>
</rss>
