<?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 Jessica Lee on Medium]]></title>
        <description><![CDATA[Stories by Jessica Lee on Medium]]></description>
        <link>https://medium.com/@jessywlee?source=rss-335dae454bd1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-E05g9t9gtTUWmlg-wO09Q.png</url>
            <title>Stories by Jessica Lee on Medium</title>
            <link>https://medium.com/@jessywlee?source=rss-335dae454bd1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:02:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jessywlee/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[JavaScript Closure - What and Why?]]></title>
            <link>https://jessywlee.medium.com/javascript-closure-what-and-why-88684cb369bc?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/88684cb369bc</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript-closure]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[closure]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Fri, 19 Aug 2022 03:30:49 GMT</pubDate>
            <atom:updated>2022-08-26T07:15:21.185Z</atom:updated>
            <content:encoded><![CDATA[<p>I have read and studied the concept of ‘closure’ in JavaScript multiple times, but it has been very difficult to get familiar with it.</p><p>This article is for refreshing myself about closures, but hope it could help readers too. This article refers to MDN official documentation and a book called Modern JavaScript Deep Dive published in Korea.</p><p>MDN defines a closure as:</p><blockquote><strong>the combination of a function and the lexical environment</strong> <strong>within which that function was declared.</strong></blockquote><p>If you are not familiar with what a lexical environment is:</p><blockquote>A lexical environment is a component of the execution context where manages identifiers and values binding to the identifiers, and records reference to the outer scope.</blockquote><p>In JavaScript, a function’s <strong>outer scope</strong>, that is, <strong>reference value of the “outer lexical environment reference” in its lexical environment</strong> is decided based on where (the environment) the function is declared, and it is decided when the function declaration is evaluated and its lexical environment is formed. This is called a <strong>lexical scope</strong> which means it does not change regardless of where the function was called.</p><p>So, what does this mean?</p><p>We can call an inner function a closure when it can still refer to the outer function’s variables even when the outer function’s lifetime has completed.</p><p>As the earlier definition of a closure states, “the lexical environment within which that function was declared” points to the scope where the function is declared, that is, its outer scope which means the lexical environment of the execution context.</p><pre>const x = 1; <br><br>function outer () {<br> const x= 10;  <br> const inner = function() {<br>  console.log(x)<br> }; </pre><pre> return inner; <br>} </pre><pre>const innerFunc = outer();<br>innerFunc(); //returns 10</pre><p>In the example above, outer function’s lifetime will be completed once it returns inner function, however, when we call innerFunc, we can still access the x variable declared in the outer function.</p><p>this is because the <strong>outer scope</strong> of the inner function has already been saved to the inner function’s environment internal slot when the inner function was declared. In other words, even when the outer function has been popped from the execution context stack and its lifetime has completed, <strong>its lexical environment is preserved because the </strong><strong>inner function refers to it as the outer lexical environment reference.</strong></p><p>Theoretically, all functions are closures. However, generally, we don’t call a function a closure if:</p><ol><li>a function does not refer to any variable in the outer scope.</li><li>a function refers to variables in the outer scope, but its lifetime is shorter than the outer function.</li></ol><p>Finally, what can we use a closure for?</p><p>We use a closure to safely save or change a state. We can achieve information hiding and allow a specific function to change states through a closure. Let’s take a look at simple examples.</p><p><strong>Example 1</strong></p><pre>let num = 0;</pre><pre>const increase = function () {<br> return ++num;<br>}</pre><pre>console.log(increase()); //return 1<br>console.log(increase()); //return 2<br>console.log(increase()); //return 3</pre><p>The example above will give us the desired result, but it is not a good code because the variable num can be accessed anywhere throughout the code and its state can change. We want to make the variable modified by a specific function only.</p><p><strong>Example 2</strong></p><pre>const increase = function () {<br> let num = 0;<br> return ++num;<br>}</pre><pre>console.log(increase()); //return 1<br>console.log(increase()); //return 1<br>console.log(increase()); //return 1</pre><p>In this example, we have made increase function the only way to modify variable num . However, the result is not what we want because the num gets declared to 0 every time the function is called.</p><p><strong>Example 3</strong></p><pre>const increase = (function () {<br> let num = 0;</pre><pre> return function () {<br>  return ++num;<br> }<br>}());</pre><pre>console.log(increase()); //return 1<br>console.log(increase()); //return 2<br>console.log(increase()); //return 3</pre><p>In this final example, the immediately-invoked function will return a closure and assigns to increase which remembers its outer scope that contains variable x. So, even if the the immediately-invoked function returned and its lifetime has completed, because the returned closure has been assigned to increase, it can still access to the outer scope’s variable.</p><p>Also, because the immediately-invoked function gets called only once, x will not be re-assigned to its initial value of 0, and because it is a private variable which cannot be referred from the outside, we can achieve safe programming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88684cb369bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vue JS: Listening to Key Events Using Computed Properties and V-model]]></title>
            <link>https://jessywlee.medium.com/vue-js-listening-to-key-events-using-computed-properties-and-v-model-d4615ce16a09?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4615ce16a09</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[quasar]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Wed, 17 Nov 2021 08:42:31 GMT</pubDate>
            <atom:updated>2021-11-17T08:42:31.976Z</atom:updated>
            <content:encoded><![CDATA[<p>There are many times that you want to listen to key events, in my case the esc key events when closing modals, popups, etc. Listening to key events in a Vue instance may not work because the key events are dispatched from the body tag that the Vue cannot control, unless the element in Vue can be focused (Using tableIndex attribute may help here).</p><p>In my case as I am using Quasar framework and want to listen to the esc key events on a Quasar modal element, so I could not use the tableIndex trick to focus the element. By default, the modal element gets unmounted when the esc key is pressed.</p><p>My goal is to reset all the data related to the modal once the modal is closed either by clicking a close button or pressing the esc key. Basically, I want to make sure the closeModal function is executed when the esc key is pressed.</p><p>There should be other workarounds to achieve the result, but here’s what I did using computed properties in Vue. The good thing was that the Quasar modal element can use v-model attribute to bind the computed property.</p><p>Firstly, you have a boolean state that changes once the openModal or closeModal function is executed, for example, isModalOpen.</p><p>Then, using a computed property and its setter, we can execute closeModal function whenever the computedIsModalOpen changes to false. For example:</p><pre>computed: {<br> computedIsModalOpen: {<br>  get() {<br>   return this.isModalOpen;<br>  },</pre><pre>  <strong>set(value)</strong> {<br>   if (!value) {<br>    <strong>this.closeModal();</strong><br>   } else {<br>    this.isModalOpen = value;<br>   }<br> },<br>},</pre><pre>...</pre><pre>}</pre><pre>methods: {<br> closeModal() {<br>  const vm = this;<br>  vm.isModalOpen = false;<br>  vm.selectedStatus = false;<br>  vm.modalItemInput = {};</pre><pre> }<br>}</pre><p>Then, the key point is that the computedIsModalOpen is bound to the modal element by v-model. This makes that when its value changes, the setter gets executed and then the closeModal function.</p><p>When the modal is open again, isModalOpen will be changed to true, and so will computedIsModalOpen.</p><pre>&lt;q-modal<br> <strong>v-model=”computedIsModalOpen”</strong>&gt;<br>...<br>&lt;/q-modal</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4615ce16a09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[v-model — Vue JS]]></title>
            <link>https://jessywlee.medium.com/v-model-vue-js-b1550de7a443?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1550de7a443</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[v-model]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Sun, 30 May 2021 11:37:53 GMT</pubDate>
            <atom:updated>2021-05-30T14:32:23.372Z</atom:updated>
            <content:encoded><![CDATA[<h3>v-model — Vue JS</h3><p>Moving to Vue from React, it was a bit difficult for me to understand the Vue way of coding. I didn’t get much time to go too deep with all the new concepts due to the timeframe to finish the project during an internship, but as I study and write codes in Vue, I learned about v-model that can be useful for writing codes efficiently. It was a little confusing (still is) to understand the concept, so this is to organize my thoughts about the concept ofv-model .</p><p>When I want to listen to a change event of inputs and update a certain state to the value entered by a user, I would make a method that takes the event as a parameter and sets the state to the e.target.value. I was doing the same with Vue JS project, but then I realized this isn’t quite a useful way although it works fine.</p><p>v-model is basically a combination of two attributes, v-bind and v-on. It lets you to write in a simpler form instead of wiring v-bind:value and v-on:input each time. Depending on which tag to use v-model for, it has different types of attributes — for input tags, it has value and input , for select tags, value and change and for checkbox tags, checked and change .</p><pre>&lt;input v-model=&quot;searchText&quot; /&gt;</pre><p>According to the Vue official document, the above code will be the same with:</p><pre>&lt;input :value=&quot;searchText&quot; @input=&quot;searchText = $event.target.value&quot; /&gt;</pre><p>In the above example, the value entered into the input by a user will be automatically updated to the searchText data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1550de7a443" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computed vs. Methods — Vue JS]]></title>
            <link>https://jessywlee.medium.com/computed-vs-methods-vue-js-1a582ad9fb69?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a582ad9fb69</guid>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Sun, 23 May 2021 09:52:49 GMT</pubDate>
            <atom:updated>2021-05-23T09:52:49.594Z</atom:updated>
            <content:encoded><![CDATA[<h3>Computed vs. Methods — Vue JS</h3><p>It has been only a few weeks studying Vue JS and the transition from studying React to Vue was a little bit confusing, because of some of the concepts were new to me. Especially, I wasn’t quite sure about when to use computed or methods. Reading an official document is always helpful, but I personally find it hard to get a clear picture of concepts by reading the document for the first time before trying it myself. So, I feel it is important to do a combination of trying it yourself and reading the document.</p><pre>computed: {<br>  scaleSize() {<br>    <em>return</em> (<em>this</em>.scaleCount / <em>this</em>.totalCount) * 100;<br>  },<br>},</pre><p>Here, scaleCount and totalCount are both props. As I am creating a poll, I need the total counts of users’ participation, and the count for each scale so that I can get the number result. I used computed here for below reasons:</p><ul><li>I need to create new data from existing data sources</li><li>I want to reduce complicated and repetitive codes to refer to the data</li><li>I am not listening to any events happening in the DOM</li></ul><p>Using methods instead of computed here would make the same result. However, the difference is that computed properties are cached and they change only when their dependencies (data inside) change. Methods re-evaluate every time they are called. So, it means that using methods instead of computed could unnecessarily run functions. It would not affect too much if it is for a simple task, but it seems to me that considering to use computed where you can (if you need caching) first before using methods can be a good habit to write a more efficient codes.</p><pre>methods: {<br>handleChoicesStatus(index) {<br> <em>if</em> (!<em>this</em>.selectMultiple) {<br>  <em>if</em> (<em>this</em>.choicesStatus[index] === false) {<br>    const newArr = <em>this</em>.choices.map(() =&gt; {<br>      <em>return</em> false;<br>  });<br>    newArr[index] = !newArr[index];<br>    <em>this</em>.choicesStatus = newArr;<br> } <em>else</em> {<br>    <em>this</em>.choicesStatus[index] = !<em>this</em>.choicesStatus[index];<br>}<br>...</pre><p>Here’s an example where I used a method. This handleChoicesStatus(index) is called when a choice from multiple choice question is clicked. I used a method because:</p><ul><li>I am listening to a click event.</li><li>The data inside the function needs to change whenever the click event happens.</li><li>the method has a parameter.</li></ul><p>Vue JS recommends to use a method when it needs to accept a parameter. However, note that you can still pass a parameter to computed property by returning an anonymous function with a parameter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a582ad9fb69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Project Setup with Vue.js]]></title>
            <link>https://jessywlee.medium.com/project-setup-with-vue-js-a4f5c7353cb5?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4f5c7353cb5</guid>
            <category><![CDATA[vue-cli]]></category>
            <category><![CDATA[project-setup]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[vue]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Sun, 16 May 2021 11:26:27 GMT</pubDate>
            <atom:updated>2021-05-16T11:26:27.643Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are using Vue.js for the very first time, we can start by installing Vue CLI. Vue CLI is a standard tooling for Vue.js development.</p><p><a href="https://cli.vuejs.org/guide/">Overview | Vue CLI</a></p><p>In your terminal, you can install by:</p><pre>npm install -g @vue/cli</pre><p>-g means global, which means you want to install Vue CLI on your whole device, not only in the specific location. Once you installed it, you can always create a new Vue project by:</p><pre>vue create my-project</pre><p>my-project is for your project’s name. Once you enter the command, you will be prompted to pick a preset. You can choose default setting or manually pick features. Here, I chose to manually pick features as I wanted to install Router, Vuex, Sass (Css Pre-processors), and Formatter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mc7sUlr8zwqdT4Tl-o-fCA.png" /></figure><p>This was especially helpful to me with installing Sass. I tried installing node-sass and sass-loader separately in my previous projects, but it kept giving me a compilation error, which seemed to be caused by the higher version of sass-loader. I downgraded it, and tried other options too but couldn’t solve the problem. Then, I tried selecting the features on the preset and it worked perfectly fine. It seemed to automatically pick the lower version that does not cause such error.</p><pre>“devDependencies”: {<br>“@vue/cli-plugin-babel”: “~4.5.0”,<br>“@vue/cli-plugin-eslint”: “~4.5.0”,<br>“@vue/cli-plugin-router”: “~4.5.0”,<br>“@vue/cli-plugin-vuex”: “~4.5.0”,<br>“@vue/cli-service”: “~4.5.0”,<br>“@vue/compiler-sfc”: “3.0.0”,<br>“@vue/eslint-config-prettier”: “6.0.0”,<br>“babel-eslint”: “10.1.0”,<br>“eslint”: “6.7.2”,<br>“eslint-plugin-prettier”: “3.3.1”,<br>“eslint-plugin-vue”: “7.0.0”,<br><strong>“node-sass”: “4.12.0”,</strong><br>“prettier”: “2.2.1”,<br><strong>“sass-loader”: “8.0.2”</strong><br>},</pre><p>After installing and creating a new project, you can run the app by:</p><pre>npm run serve</pre><p>You can also use the GUI where you can manage your projects on a graphical interface:</p><pre>vue ui</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4f5c7353cb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WeCode Internship Course — Week 1]]></title>
            <link>https://jessywlee.medium.com/wecode-internship-course-week-1-21a21e0d502f?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/21a21e0d502f</guid>
            <category><![CDATA[project-planning]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Fri, 14 May 2021 10:29:25 GMT</pubDate>
            <atom:updated>2021-05-14T10:29:25.168Z</atom:updated>
            <content:encoded><![CDATA[<h3>WeCode Internship Course — Week 1</h3><p>Whoa, two months at WeCode are already gone! I can’t believe time flies so fast. As for the final month at WeCode bootcamp, students have a choice of internship and team projects. I chose an internship as I thought it would be a great opportunity to gain some experiences in the field.</p><p>I started my internship at Medistream with one of my back-end classmates from the last Monday. It is a startup company where provides various services including social networking, e-commerce, education, specifically for oriental medicine doctors and students. Having such a specific target was very interesting, and the company is growing fast.</p><p>In terms of the development specification, the company uses Vue js. I am just starting to get used to React and now need to learn Vue! I was a little bit worried but excited at the same time that I can add more skills under my belt.</p><p>Our project is to develop a poll system that can be used independently of the company. Ideally, it is to be a library package that can be installed. In this project, we are asked to do the whole planning from the scratch. I haven’t done much planning from the previous projects, so it was quite challenging because I had no idea where to start. However, my team gave us advice about researching for resources to use.</p><p>Also, I could experience how the development team works on a daily basis. They introduced us what kind of tools they use to keep each other up-to-date about the work progress. They used some software that are similar to Notion and Trello. We do everyday scrum meeting for a short 10–15 minutes ideally. I really liked the fact that they hold a seminar every two weeks on a development related topic that each team member has strength in, so that team members are motivated to learn from each other.</p><p>Back to the project, we started research on libraries and poll services that we could refer to. There are so many poll services like on Youtube, Google Forms, Instagram, Naver, Kakao Talk and so on. We browsed those services and started drawing the big picture. Some of the services are too complicated and detailed, but as our goal is to develop a simple and quick poll that has potential to be expanded later on, we tried to start small. We also came up to learn about the library, Survey JS, that provides a survey creator and survey with lots of options and details. It helped us a lot to have clearer idea about what kind of data should be sent and received.</p><p>By this week, our goal is to finalize planning. We wrote up a functional specification that lists up all the details for each function to be developed. We classified all the functions from the broad to narrow categories, included descriptions for each, what happens from the front-end and back-end, endpoints, components, etc. I thought the document would be quite simple and short but when we finished, it looked quite overwhelming lol.</p><p>Today, we had a team meeting to review the specification we developed and finalize the planning, and discuss on the next steps. We decided to create most of the functions that we suggested. The next step was to come up with JSON data structure with keys, then, I could start on finally developing UIs! I am planning on finishing the initial setting on the weekend and hopefully do some coding. The next week should be challenging and fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21a21e0d502f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 2nd Team Project at WeCode Bootcamp]]></title>
            <link>https://jessywlee.medium.com/the-2nd-team-project-at-wecode-bootcamp-613cf9dc5a19?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/613cf9dc5a19</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Sun, 09 May 2021 13:45:23 GMT</pubDate>
            <atom:updated>2021-05-10T00:53:43.790Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*8TWdHMztf7eStQjZDHr2Gw.gif" /></figure><h3>Starting the project</h3><p>Can’t believe my second project at WeCode has finished already! The last 2 weeks have been pretty crazy, lots and lots of fun and learning. This is to share my journey with the second team project.</p><p>My second project is to clone one of the most popular recruiting platforms in Korea, Wanted. We came up with our team project name and logo, &lt;GetWanted/&gt;, which shows that we chose to make a recruiting website for developers particularly. There are six members in the team including me, three for front-end and back-end each.</p><p>Although it is a clone project, our goal is not on cloning the web app identically. We aim to realize various functions on our own, especially the ones that we couldn’t experience from the last project. So, my team members and I shared what we did from the last project and assigned work based on what we can learn the most from.</p><p>My part was the resume file management page, resume writing page and the job post details page. I am going to share some codes in the coming section.</p><h3>Team Work and Scrum</h3><p>This time, we used Trello again, to update each other everyday on the progress and and share information. Meetings were pretty straight forward and quick, and most of our work was handled on time. Everyone worked hard on weekends and holidays, and I am proud of my team who did their best to complete each part. Once again, I realized communication between team members is extremely important. Next time, I hope to have more constructed communication with back-end members, as I found that the picture each team member is drawing can be very different from each other and it requires a lot of time to agree on if we find the difference too late.</p><h3>Work Details Summary</h3><p>The features I developed for this project include:</p><h4>Resume Storage</h4><ul><li>Upload PDF files</li><li>Add, delete, modify resume files</li><li>Load resume forms</li><li>Dynamic routing</li></ul><h4>Resume Writing</h4><ul><li>Auto-complete basic personal info</li><li>Add/delete work experiences</li><li>Save as draft / finish and update the storage</li></ul><h4>Job Posts</h4><ul><li>Employer image carousel</li><li>Display employer’s location by using Kakao map api</li><li>Load the user’s resumes and submit files to the post</li></ul><h3>Gists to Share</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/385ee67adb8c259313b0cf154cf531b6/href">https://medium.com/media/385ee67adb8c259313b0cf154cf531b6/href</a></iframe><p>On this project, I had to use a lot of fetch functions to get and post information working with the server side. In the later phases of the project, we had a session about reusing functions. I wanted to do some refactoring on my codes, especially fetch functions so that I don’t have to repeat writing the same lines over and over.</p><p>Above reuseFetch takes four parameters, api, method, token and payload. Methods that I used were only GET and POST so I used if condition for POST as it needs options.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f4d7d661ca37020c05361e11ac53fe2/href">https://medium.com/media/4f4d7d661ca37020c05361e11ac53fe2/href</a></iframe><p>The second gist I want to share is about enabling the submit button on the job post details page. The feature I had to develop has the following requirements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*cMcF6_0l12t596-nG1fC7w.gif" /></figure><ol><li>There are checkboxes of file attachment that the user posted on the account, which means the number of files can be different.</li><li>The submit button (제출하기) should be enabled and changed in color when at least one of the checkboxes is checked.</li><li>The submit button should remain enabled when a number of checkboxes are checked, as multiple files can be submitted.</li><li>When unchecking checkboxes, the submit button should go disabled when all the checkboxes are unchecked.</li></ol><p>It was quite tough for me to develop this feature because I was not sure about on what component I should manage the states for the checkboxes. Originally, I had the states on the checkbox component, as I thought each box should have its own state so that each box can be checked individually. Then, I had the submitReady state on its parent component. The problem was, although I was able to enable the submit button when multiple checkboxes are checked, as soon as one of them is unchecked, the submit button went disabled.</p><p>With help from my mentor, I realized that the states for each checkbox should be managed from the parent component as well. But, as the number of checkboxes are different depending on how many files the user uploaded, I had to think about how to get the number of states. So, I used map function to return boolean state for each file in the array of resumeList.</p><p>Then, handleCheckBoxClick changes only the selected checkbox’s state in the array. Finally, checkSubmitReadyfunction checks if at least one checkbox is clicked, the submitReady state should be true, otherwise remain false. This feature was more complicated that I thought would be. As a user, I would have never imagined such simple looking feature needs such logics behind, haha.</p><h3>Finishing the project</h3><p>On the day of final presentation, I was not too happy with the result. Everything worked fine until last night, but for some reason, some of the features on the resume page didn’t work so well. We couldn’t make it perfect on the presentation but still, I am proud of my work and progress that I have made so far at the bootcamp. Looking back to the start of the camp, what we all have accomplished is quite crazy!</p><p>From tomorrow, I am starting my one-month internship at a start-up company. I am nervous and excited at the same time. I look forward to learning so much more from working with developers in the field, and one month from now I will be more ready as a junior developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=613cf9dc5a19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 1st Team Project Review at WeCode Bootcamp]]></title>
            <link>https://jessywlee.medium.com/the-1st-team-project-review-at-wecode-bootcamp-c38f9fae8c29?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c38f9fae8c29</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[web-app-development]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Sat, 24 Apr 2021 18:06:05 GMT</pubDate>
            <atom:updated>2021-04-24T18:47:31.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Z_eMHjPbM03GyOLh1L1Zeg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*GDVjDasFB3UkNUHUWejbfQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1oJh5284-nRu6EV9A3TsaQ.gif" /></figure><p>6 weeks at WeCode Bootcamp have already passed. As finishing the foundation course, we started a 2-week team project that ended yesterday with a final presentation. This blog is to review my team project and reflect on it.</p><h3>Starting the project</h3><p>Before talking about the project process, I had some issue that happened right before the project started. Unfortunately, I was notified that a close person to me contacted with a COVID positive person, and eventually was confirmed positive too on the Monday when the project kicked off. I was obligated to quarantine for the next two weeks. I was upset that I could not be at school for the project, and frustrated and worried about the whole situation.</p><p>However, I could not sit and be upset. I couldn’t do anything for what already has happened, and decided to do my best not to affect our work and team members. Now the two weeks have passed, I can assure myself I learned a ton not only in knowledge, but also mentally. I will write about this more in the coming sections.</p><h3>Project Team and Topic</h3><p>Our team consists of six members, three people for the front-end and back-end each. I notified one of my close team members about my situation, and we immediately met on Google Meet.</p><p>Our project topic was to clone Market Kurly web app which is the one of the most popular online food shopping website in Korea. They have a lot of products introduced on the main page with many categories, and have many functions that we could practice and learn from.</p><p>We came up with a new name “Market ChoKurly” as we chose the chocolate category specifically to clone from the web app because we could not make everything in such a tight time frame.</p><h3>Work Distribution and Goals</h3><p>Thankfully, team members suggested me for a PM position. I have never worked as a PM before, and considering the situation with quarantine, I was quite worried. However, I thought this will be a rewarding experience at the end, so I gladly took the suggestion and was excited to work hard.</p><p>We decided to create the main page, product list page, product details page, login, signup and cart pages. There are also components to be shared across all pages, which are the navigation bar, footer, and the aside bar. The front-end members were willing to take any parts as we thought all of them would be a lot of learning for us. So we took a draw to decide which parts each one will take. I ended up taking the navigation bar, main page, and the product list page.</p><h3>Team Work and Scrum</h3><p>Our daily standup meeting started at 11:10 a.m. every day. As I could not be at school, we always met on Google Meet. on Mondays, we plan on work to be finished by the week. Every day, we start by updating on each other about what we have finished yesterday, and what we have not. We discuss on the day’s plan and goals. If there are any blockers that could possibly cause the delay, we discuss about them. Based on what we discussed during the meeting, we updated the cards on Trello. One of our team members uploaded the meeting agenda on Trello as well. As we get busier, we sometimes got a little bit late on updating Trello, but seeing the cards piling up on ‘done’ column helped us to realize how far we have come and what we have not accomplished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J3NjCdtv1UPLd2LHDJlY7A.png" /></figure><h3>Gists to share</h3><h4>Hover-and-expand Category Menu</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/45c24c14328b06c0de3376141c8079bc/href">https://medium.com/media/45c24c14328b06c0de3376141c8079bc/href</a></iframe><p>One of the hardest codes on this project for me was to create the category dropdown menu. The Market Kulry has the main category list which appears on mouse hover, and when the main category is hovered, the subcategory of each appears on the right. The data fetched from the back end has subcategories inside each main category which consist of arrays in an array. So, I thought to use map methods twice, but struggled to make the only corresponding subcategory list to appear for the selected main category.</p><p>I used the onMouseEnter event handler and saved the main category’s id to categoryIdx state, and change isSubOpen to true. Using the conditional rendering, I wrote conditions to check if categoryIdx and the data index + 1 match, and if isSupOpen is true. If the conditions are turned true, the corresponding subcategory is mapped.</p><h4>Carousel</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff8ddd6f675e399f7b9f069f608e8a20/href">https://medium.com/media/ff8ddd6f675e399f7b9f069f608e8a20/href</a></iframe><p>The main page consists of different types of carousels. I created a carousel component and imported a product card component to be showed in the frame. Market Kurly has four pictures of products in one slide, some of them move by two pictures or four with one click.</p><p>First, I passed the product data using map method to the child component ProductCard. Also, I used transform style with translateX to the child component as well. Then, onClick handlers are used on the two buttons to move the x axis of the pictures.</p><p>Used in goLeftand goRight functions,slideX is a prop passed from the parent component, which is the value representing how many pictures to move with one click. Also, if the x is 0, meaning it is in the first position, the slide should not be moved to the left anymore, but go back to the ending position. I used the ternary operator and setState to assign the x position.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5b9736bd51818b630bc0cae7947128d/href">https://medium.com/media/a5b9736bd51818b630bc0cae7947128d/href</a></iframe><p>This code is for creating a timer in HH:MM:SS form to be used in 24 hour limited sales section. I did some googling and learned it from tutorials. Before refactoring, the code looked quite complicated. Our team mentor asked to use variables where I can, and now the code looks much cleaner and simpler so I am satisfied with it.</p><pre>const twoDigits = time =&gt; { return (time &lt; 10 ? ‘0’ : ‘’) + time; };</pre><p>This simple function is to make a single digit number to have 0 in front of it. So, instead of ‘7’, ‘07’ appears in a timer.</p><h3>Pagination</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82c5494ae635f18f56c8f5d367d5e113/href">https://medium.com/media/82c5494ae635f18f56c8f5d367d5e113/href</a></iframe><p>Finally, this is a code for pagination on the product list page. When the page number button is clicked, the corresponding API should be fetched. I used states and a parameter and embedded them in the API address using the template literal.</p><h3>Accomplishments</h3><p>First, I would like to pat myself on the back for finishing the project successfully despite the quarantine. I expect that developers work remotely a lot, so this experience could actually be a good practice. Personally I was very worried about the person who was covid positive and the whole situation was tough to deal with at first, but now that I have successfully worked throughout the project, I feel like I grew stronger mentally and gained much confidence about myself that I could do a project in a dynamic situation.</p><p>Also, I think our team work was awesome. We worked together on Google Meet until 5 a.m. on the final day of the project. I had so much fun working with them, and putting our work together and fixing errors.</p><p>Knowledge wise, I became much familiar with using states, and had opportunities to think about how to plan and use components more efficiently. Additionally, I learned about and practiced on concepts and functions including event handlers, conditional rendering, ternary operator, dynamic routing, pagination, map method, creating carousel and timer using various functions.</p><h3>What to improve</h3><p>I had to invest much time on working with the back end at first, because I didn’t know about what is the best way to connect with their local server while I am remote. My mentor told me about the live share extension from VSC, which lets you to share the same server. Although it was tougher to work remotely from the back end, I think it was a good learning experience and everything went well overall.</p><p>There are a few things that I could have done better. The filtering function on the product list page somehow didn’t work on the first click (working fine on the second click!). Also I wanted to additionally realize the search filter function but couldn’t in this time frame. Our web app is not responsive to different screens, so some features go out of positions on larger or small screens, which I would like to fix later.</p><h3>Finishing the project</h3><p>We also learned how to deploy our proejct on AWS — EC2. I have deployed our front-end part, but the back end has not yet. If they do soon, the web app will be accessible by anyone.</p><p>Once again, I realized the team work and communication is the most important key in a team project. I would like to thank team members who understood my situation and helped me throughout the process. I feel very proud of the team who worked best for the same goal. Also, I would like to thank mentors who assisted me a lot on Zoom and Google Meet.</p><p>The final presentation was yesterday, and although I could not be there I watched them through Zoom. Our team has done an amazing job and the whole project process was such a rewarding experience. At first, I thought being alone remote from everyone else during the project will be so hard. However, I think this experience turned into my unique story and improved myself. As a PM, I don’t think I did something too extra, but tried to lead the meeting, ask questions, and update on each other as clearly and fast as possible. This was such a great project and I hope the next (starting right on the next Monday!) will be a better one applying what I have learned from this one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c38f9fae8c29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 1st Team Project Review (at WeCode Bootcamp)]]></title>
            <link>https://jessywlee.medium.com/the-1st-team-project-review-at-wecode-bootcamp-25a3bd040bf4?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/25a3bd040bf4</guid>
            <category><![CDATA[codingbootcamp]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Sat, 24 Apr 2021 11:13:32 GMT</pubDate>
            <atom:updated>2021-04-25T10:22:04.419Z</atom:updated>
            <content:encoded><![CDATA[<h3>찬란했던 1차 그룹 프로젝트 후기 @ <a href="https://medium.com/u/83659dd74d7d">WeCode</a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Z_eMHjPbM03GyOLh1L1Zeg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*GDVjDasFB3UkNUHUWejbfQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1oJh5284-nRu6EV9A3TsaQ.gif" /></figure><p>벌써 위코드의 부트캠프를 시작한지 6주가 지났다. Foundation 코스를 마치고 4월 12일 부터 23일까지 2주간 첫번째 팀 프로젝트를 진행하고 어제 프리젠테이션을 마쳤다. 오늘은 이번 2주간의 기간을 회고하는 시간을 가지며 블로그를 작성해 보려고 한다.</p><h3>프로젝트를 시작하며</h3><p>이번 프로젝트 후기를 본격으로 이야기 하기에 앞서, 프로젝트를 시작하기 직전 주말에 일어났던 일은 나에게 개인적으로도, 다른 사람들과 같이 공부하는데에도 엄청난 변화를 끼쳤다. 정말 안타깝게도, 최측근 중 한 명이 코로나 밀접 접촉자라는 사실을 알게되었고, 결국 확진의 소식을 월요일 아침에 받아야 했다. 난 2주간의 격리가 불가피한 상태였고, 이것이 이번 프로젝트 첫날의 아침에 일어난 일이였다. 처음에는 정말 멘붕이였고, 주말 내내 걱정되어 잠이 오지 않았다. 이 상황이 원망스럽기도했다. 왜 하필 지금 ㅠㅠ…</p><p>하지만 그렇게 화나있을 시간이 없었다. 이미 일어난 일은 어쩔수 없고, 이 일이 프로젝트의 결과 그리고 팀원들에게 영향을 주지 않도록 최대한 열심히 하는것 밖에는 딱히 할 것이 없었다. 그리고 지금은 벌써 2주가 흘렀고, 이 2주를 통해 난 기술적뿐만 아니라 정신적으로도 엄청난 성장을 한 것 같다. 그것에 대해서는 마지막에 쓰겠다.</p><h3>프로젝트 소개</h3><p>어쨌든, 아침에 위코드에 소식을 알리고, 난 집에서 팀 발표를 받았다. 우리의 팀은 총 6명! 동이님, 준형님, 승찬님, 영훈님, 정현님이였다. 난 팀원들 중 가장 잘 알았던 동이님께 내 소식을 먼저 알리고 동이님은 그날부터 나와 끝이없는 구글밋의 굴레에 빠져들게 되었다…ㅋㅋ</p><p>우리가 클론하는 프로젝트는 마켓 컬리였다. 마켓 컬리는 국내 식품 온라인 쇼핑몰로 가장 유명한 브랜드 중 하나다. 우리는 바로 구글밋을 켜서 회의를 시작했다. 일단 어떤 페이지와 기능을 구현할 수 있을지, 하고싶은지에 대해 이야기 하였다. 시간이 2주밖에 없어서 모든 기능을 구현할수는 없기 때문에 가장 기본부터 시간이 허락하는 내에서 추가적으로 구현하고 싶은 기능들을 정리하였다. 또, 팀이름을 정하였다. 이름은 마켓 쵸컬리(Market Cho-Kurly)! 우리는 마켓 컬리에서 간식, 과자, 떡 카테고리 중 초콜릿, 젤리, 캔디의 부분을 구현하기로 해서 동이님의 센스로 나온 찰떡같은 이름이다.</p><h3><strong>역할 분담과 구현한 기능</strong></h3><p>우선 너무 감사하게도 팀원들이 나에게 PM의 자리를 맡겨주었다. 나는 PM을 해본적이 없기도 했고, 격리 중인 상태에서 좀 걱정이 되긴했지만 이것 또한 못해볼 경험이라고 생각하고 열심히 해봐야겠다고 다짐했다.</p><p>우리가 기본적으로 구현할 페이지는 크게 메인 페이지, 상품 리스트 페이지, 상품 상세 페이지, 로그인, 회원가입, 장바구니였다. 프론트 멤버들은 모든 페이지에서 사용되는 상단 헤더, 어사이드, 푸터를 프론트 멤버들 각각 하나씩 나누기로했다. 솔직히 뭘 맡아도 다 어렵고 배울점이 많을것 같아서 공평하게 사다리 타기로 역할을 분담했다. 나는 상단에 들어가는 네브 바, 메인 페이지, 상품 리스트 페이지를 맡게 됐다.</p><h4>네비게이션 바</h4><p>우선 공통으로 사용될 컴포넌트인 상단 네비게이션 바부터 시작하였다. 먼저 레이아웃을 HTML, SASS를 사용하여 짜고, 기능으로 넘어갔다. 네브 바는 들어가는 기능이 많지 않았다. 전체 카테고리에 마우스 올리면 카테고리 리스트가 나타나고, 카테고리에 또 마우스를 올리면 서브 카테고리가 나타나는 식의 기능이 가장 큰 것이였다. 난 이 기능이 생각보다 빨리 끝날 것이라고 생각하였지만 아주 잘못된 생각이였다. 이 기능만 3일을 고민하였고, 이것 저것 해보다가 도저히 시간만 지체할 수는 없어서 멘토님에게 힌트를 받아 겨우 성공 할 수 있었다. 이 코드는 밑에 정리해 보겠다.</p><h4>메인 페이지</h4><p>메인 페이지에는 크게 두,세가지의 기능이 있었다. 첫번째는 자동으로 넘어가는 캐러셀이였다. 페이지 상단에는 하나의 사진이 가로 전체를 덮고 약 5초에 한번씩 자동으로 넘어가고 화살표 버튼으로도 작동할 수 있다. 메인 페이지의 나머지는 모두 네개씩의 상품 사진이 한 프레임에 담겨 넘어가는 캐러셀로 구성되어 있었다. 신상품, 알뜰 상품 등 총 6개의 품목에 따라 각 캐러셀에 상품들이 담겨 보여진다. 그리고 중간에는 24시간 한정 세일을 하는 상품이 소개되며, 이 곳에 타이머를 추가로 기능을 구현하였다. 타이머는 생각보다 빨리 구현하였고, 캐러셀은 초반에 좀 고생을 하였다. 라이브러리를 사용하지 않고, 직접 하려다 보니 어려웠던 것 같다. 또, 하나의 사진만 보여지는 캐러셀에서 네개를 한번에 보여주는 것으로 적용을 하려니 조금 헷갈렸지만 네브 바 보다는 쉽게 구현하였다.</p><p>메인 페이지에서는 크게 네브 컴포넌트, 슬라이드 컴포넌트, 상품 카드 컴포넌트, 그리고 태그에 따라 필터링이 들어가야 해서 사용했던 태그 컴포넌트가 있다.</p><h4>상품 리스트 페이지</h4><p>상품 리스트 페이지에서는 크게 서브 카테고리로 상품 리스트를 필터링 기능, 신상품과 가격순으로 필터링 기능, 장바구니 아이콘을 누르면 띄워지는 모달 창, pagination 등이 있었다. 메인의 캐러셀에서도 사용했던 상품 카드 컴포넌트를 그대로 사용하였고, className에따라 사이즈를 조정해 주었다. 또 동적 라우팅을 이용해서 필터링된 데이터를 불러와 보여주었다. 장바구니 모달 창도 한번도 해보지 않은 기능이여서 재밌었고, 동적 라우팅을 통해 다른 데이터들이 불러오는 기능을 구현한것도 뿌듯했다.</p><h3>협업 과정 그리고 Scrum</h3><p>우리는 매일 아침 11시 10분에 모여서 daily standup meeting 을 하였다. 내가 학원에 가지 못했기 때문에 항상 구글밋을 키고 팀원분들이 모여 미팅을 진행하였다. 어제 마친 작업들을 서로 업데이트하고, 오늘 할일을 정리해 보고, 진행을 더디게 하는 blocker 가 있다면 공유하였다. 미팅이 너무 늘어지지 않게 신속하게 진행하고 바로 할 일로 넘어갔다. Trello에 카드들을 업데이트 하면서 우리가 지금까지 한 것들, 진행중인 것들, 아직 못한 것들을 한눈에 보게 해주었고, 영훈님이 센스있게 daily standup meeting 의 내용도 Trello에 올려주셨다. 바쁘다 보면 제때 업데이트를 안할 때도 있었지만 나중에 done에 쌓여가는 카드들을 보니 우리가 많은걸 했구나, 어떤것은 못 했구나를 알수 있어 좋았다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uaT1OA480NwnXXpHtt4lOQ.png" /></figure><h3>기억에 남을 코드</h3><h4>카테고리 메뉴</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/45c24c14328b06c0de3376141c8079bc/href">https://medium.com/media/45c24c14328b06c0de3376141c8079bc/href</a></iframe><p>이 코드는 가장 고생했던 기능 중 하나인 마우스 호버로 카테고리를 나타내는 기능이였다. 우선, 백엔드에서 받아오는 데이터는 각 메인 카테고리안에 서브 카테고리의 리스트가 담긴 array안에 array가 있는 형식이였다. map 메소드를 두번 써야할 것 같다는 것은 감이 왔지만, 어떻게 하면 하나의 메인 카테고리에 마우스 호버를 했을때 그것에 해당되는 서브 카테고리만 보여지게 하는가였다. 이런 저런 방식을 시도하다 시간이 너무 지체되어 멘토님의 힌트를 받았다. 우선 메인 카테고리에 onMouseEnter 핸들러를 사용해 id 를 categoryIdx 스테이트에 저장해주고, isSubOpen 스테이트를 true 로 바꿔준다. 그리고 조건부 렌더링을 통해, 데이터의 인덱스 + 1과 categoryIdx 가 같은지, isSubOpen 가 참인지의 조건을 달아 만족될 시 해당 서브 카테고리를 map 메소드를 통해 보여주었다.</p><h4>캐러셀</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff8ddd6f675e399f7b9f069f608e8a20/href">https://medium.com/media/ff8ddd6f675e399f7b9f069f608e8a20/href</a></iframe><p>이 코드는 메인 페이지에서 사용된 캐러셀을 구현한 코드이다. 자식 컴포넌트인 ProductCard 컴포넌트에게 상품 정보가 담긴 데이터를 map 메소드를 통해 전해주고 moveX 라는 x 축을 이동시키는 transform 스타일을 넘겨준다. 그리고 캐러셀 양쪽에 있는 버튼에 onClick 핸들러를 통해 함수를 실행시킨다. slideX 는 부모인 Main 컴포넌트에서 받아온 props 인데 한번 클릭에 몇개의 사진을 넘길 것인지에 대한 값이다. 총 네개의 사진이 하나의 틀에 보여지는 상태에서 2 이면 두개가 넘어가고 4이면 네개가 넘어가는 형태이다. goLeft 와 goRight 에서 x 축을 얼마만큼 넘겨줄것인지 설정해준다. 예를 들어, x가 0일때, 즉 맨 처음에 위치해 있을때는 왼쪽 버튼을 클릭해도 계속 왼쪽으로 넘어가면 안되므로 그 조건을 달아주어 삼항 연산자를 이용해 setState 해주었다.</p><h4>타이머</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5b9736bd51818b630bc0cae7947128d/href">https://medium.com/media/a5b9736bd51818b630bc0cae7947128d/href</a></iframe><p>이 코드는 특정 날짜가 오늘부터 얼마나 남아있는지 시간:분:초 단위로 나타내주는 타이머 기능이다. 구글링을 통해 짤수 있었다. 리팩토링하기전에는 함수가 복잡해 보였는데 멘토님이 변수화 시킬수 있는 부분은 다 해주는게 좋다고하셔서 정리를 해주었더니 그전보다는 깔끔해 보여 맘에 든다.</p><pre>const twoDigits = time =&gt; { return (time &lt; 10 ? ‘0’ : ‘’) + time; };</pre><p>이 함수는 시간 단위가 한자리 수 일때 ‘7’이 아니라 ‘07’ 의 식으로 표현되어야 하기 때문에 추가해준 간단한 함수인데 특히 기억에 남는다.</p><h4>페이지네이션</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82c5494ae635f18f56c8f5d367d5e113/href">https://medium.com/media/82c5494ae635f18f56c8f5d367d5e113/href</a></iframe><p>마지막으로 페이지네이션에 사용한 함수이다. 버튼을 클릭했을때 fetch 되어야할 api주소에 state 와 parameter를 template literals 를 사용해 적용해줘서 해당되는 페이지가 렌더링 될수 있도록 해줬다.</p><h3>이루어낸 것들</h3><p>우선 격리의 상황에서도 무사히 프로젝트를 마친 나에게 토닥토닥 해주고싶다. 그리고 꼭 이런 상황이 아니라도 개발은 리모트로 진행되는 상황이 아주 많을텐데 미리 경험해 보아서 오히려 좋았던 것도 있다. 개인적으로도 나의 최측근에게 이런일이 일어났다는게 정신적으로 힘들었는데 이렇게 잘 해내고 나니 내가 생각보다 나약한 사람은 아니구나(?) 라는 자신감이 생겼다 ㅋㅋㅋ 이제 무슨 상황에서도 프로젝트를 할수 있다는 자신감!</p><p>그리고 팀원들과의 소통, 팀워크도 아주 좋았다고 생각한다. 발표 마지막날, 거의 새벽 5시까지 구글밋 두개를 동시에 켜가며 (프론트 하나, 백 하나) 문제를 해결하고 마지막까지 불태우면서 최선을 다한 것이 힘들었지만 뿌듯하고 재미있었다. 백엔드 분들이 임의로 지으신 상품 이름들을 보며 집이 떠나가라 웃은것도 기억난다..ㅋㅋ 큰웃음과 센스 감사합니다.</p><p>지식적으로는, state 라는 개념에 전보다 훨씬 익숙해지고, 어떻게 하면 더 효율적으로 component를 사용해야할까 고민할수 있었다. 그밖에 이벤트 핸들러, 조건부 렌더링, 삼항 연산자, 동적 라우팅, 페이지네이션, 맵 메소드, 캐러셀 구현, 타이머 구현 등등 수많은 개념과 함수에 대해 배울수 있었다.</p><h3>아쉬운 것들</h3><p>처음에는 백엔드와 맞춰봐야 할때 시간을 상당히 소모해야했다. 나는 학원에 갈수가 없으니 백엔드의 서버랑 연결할 방법을 딱히 몰랐기 때문이다. 하지만 멘토님이 알려준 live share 라는 VSC의 익스텐션을 사용해서 떨어져있어도 서버를 쉐어 할수 있었다. 다만, 바로 옆에 있지 않으니 서버가 꺼지거나 문제가 생길때 신속하게 해결할수 없었던 점이 조금 답답하기도 했다. 그래도 전체적으로 수월하게 진행되었다고 생각한다.</p><p>좀 더 꼼꼼하게 구현하고 싶었던 기능들도 몇가지 있다. 상품 리스트 페이지에서 신상품순, 가격순으로 sorting 을 해주는게 있었는데, 처음 클릭할때는 실행이 안되는 문제가 있었다. 그리고 검색창을 통한 필터 기능도 추가적으로 구현하고 싶었지만 시간상 하지 못했다. 다른 팀원들이 맡아준 장바구니 페이지도 백엔드와 맞추면서 코드 수정이 많았는데 모두가 붙어서 마지막까지 해결해보려고 했지만 미흡한 점이 있었다. 시간관리, 처음 계획 단계에서 어떤 컴포넌트들이 서로 연결되는지에 대한 이해, 백엔드와의 데이터에 대한 계획과 소통이 참 중요하다는 것을 깨달았다.</p><h3>프로젝트를 마치며</h3><p>우선 프로젝트는 정말 팀과의 소통이 중요하고, 혼자는 할수 없다는 것을 다시 한번 깨달았다. 나의 상황을 이해해주고 배려해준 팀원들이 고마웠고, 불평하지 않고 서로 하나의 목표를 향해 각자의 맡은 바를 최선을 다해 이뤄준 점이 감사했다. 또 멀리있는데도 도저히 해결안되는 기능들이 있을때마다 도와주신 멘토님들도 너무 너무 감사하다.</p><p>처음에는 나만 떨어져 있어서 더 힘들거라고 생각했는데, 오히려 이런 경험으로 나만의 스토리를 만들수 있다는 생각으로 열심히 했다. 그래서 더 뿌듯하다. PM 으로서 뭔가 특별하게 더 한것은 없다고 생각하지만 미팅을 더 이끌어가고, 질문을 하고, 서로 업데이트를 신속하게 하도록 노력했다. 우리 팀 모두 최선을 다해서 자랑스럽고 다음 프로젝트때는 이번에 느낀 점들을 참고해서 더 좋은 과정과 결과를 만들기를 바래본다.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25a3bd040bf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create An Outside Click Handler in React JS]]></title>
            <link>https://jessywlee.medium.com/create-an-outside-click-handler-in-react-js-8e8c20c47d95?source=rss-335dae454bd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e8c20c47d95</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Jessica Lee]]></dc:creator>
            <pubDate>Sun, 11 Apr 2021 07:08:40 GMT</pubDate>
            <atom:updated>2021-04-11T07:17:01.186Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is about how to create an outside click handler in React using createRef(). There are hooks that you can install to achieve this, but I wanted to try figure out myself. The feature that I created is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*wxzkZP00XgoGNL7qSoVrdg.gif" /></figure><p>As you can see above, when the search input is clicked, the placeholder, search icon is moved to the left and the cancel icon appears. When the outside of the input is clicked, they go back to the initial position and the cancel icon disappears. Let’s look at the codes below:</p><pre>class Header extends Component {<br>constructor() {<br>super();<br><em>this</em>.state = {<br>  searchInput: “”,<br>  <strong>searchIcon: false,<br>  searchPlaceholder: false,<br>  cancelIcon: false</strong><br>};</pre><pre><strong><em>this</em>.searchRef = React.createRef();</strong></pre><pre>}</pre><ol><li>I have searchIcon, searchPlaceholder, and cancelIcon’s states set as above, and then created searchRef using React.createRef(). According to the React official documentation, Refs provide a way to access DOM nodes or React elements created in the render method. Refs can be used when we mange focus, text selection, or media playback. They are not to be overused for anything that can be done declaratively. Refs are usually assigned in the constructor so that they can be referenced throughout the component.</li></ol><pre>&lt;input<br><strong><em>ref</em>={<em>this</em>.searchRef}</strong><br>/&gt;</pre><p>2. Then, the ref is added to the DOM element, input in this case, using ref attribute.</p><pre><strong>clickOutside = (e) =&gt; {<br><em>if</em> (!<em>this</em>.searchRef.current.contains(e.target)) {<br></strong>const { searchIcon, searchPlaceholder, cancelIcon } = <em>this</em>.state;<br><em>this</em>.setState({<br>  searchIcon: !searchIcon,<br>  searchPlaceholder: !searchPlaceholder,<br>  cancelIcon: !cancelIcon,<br>  });<br> }<br>};</pre><p>3. Now we have the ref to the search input, I created the event handler function using contains() that checks if the searchRef does NOT contain e.target, the states of icons and placeholder are set the opposite. This will detect the click outside of the search input and get the icons and placeholder go back to the initial position. I also have onClick handler separately that moves their positions when the input is clicked.</p><pre>componentDidMount() {<br>document.addEventListener(“click”, <em>this</em>.clickOutside);<br>}</pre><pre>componentWillUnmount() {<br>document.removeEventListener(“click”, <em>this</em>.clickOutside);<br>}</pre><p>4. I added the event listener of clickOutside in componentDidMount(). It is invoked immediately after the component is mounted. Initialization that requires DOM nodes should go here. Then, I also added componentWillUnmount() to remove the event listener, which is the function to be called right before the component removed from the DOM. It is usually used for a clean-up for any DOM element or timer created in componentDidMount().</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e8c20c47d95" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>