<?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: Kelvin Acosta</title>
    <description>The latest articles on DEV Community by Kelvin Acosta (@kelvinacosta).</description>
    <link>https://dev.to/kelvinacosta</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%2F1082778%2Fb2153093-6461-434a-a3de-4a74c7f88926.jpeg</url>
      <title>DEV Community: Kelvin Acosta</title>
      <link>https://dev.to/kelvinacosta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kelvinacosta"/>
    <language>en</language>
    <item>
      <title>Learning React</title>
      <dc:creator>Kelvin Acosta</dc:creator>
      <pubDate>Tue, 11 Jul 2023 01:39:18 +0000</pubDate>
      <link>https://dev.to/kelvinacosta/learning-react-58ac</link>
      <guid>https://dev.to/kelvinacosta/learning-react-58ac</guid>
      <description>&lt;p&gt;It's been my first time learning about this technology. I will not lie about this. It has been super hard learning for me. One thing that was not getting into my mind its states. &lt;br&gt;
"A state represents the current condition or state of the component, which can change over time due to user interaction, data updates, or other factors". Best definition I got it when I was doing my research. &lt;/p&gt;

&lt;p&gt;When I got to this point I was confused but I get now:&lt;/p&gt;

&lt;p&gt;const [recipe, setRecipe] = useState(null);&lt;/p&gt;

&lt;p&gt;.Declaring a constant variable &lt;/p&gt;

&lt;p&gt;.[recipe, setRecipe] uses array destructuring syntax to declare two variables.&lt;/p&gt;

&lt;p&gt;.It assigns the first value returned by the useState hook to the recipe variable and the second value to the setRecipe variable.&lt;br&gt;
.By using setRecipe, you can later update the recipe state by invoking it with a new value. &lt;br&gt;
."null" In this case it is just the initial value as argument given.&lt;/p&gt;

&lt;p&gt;This line of code initializes a state variable called recipe with an initial value of null and provides a function setRecipe that can be used to update the recipe state.&lt;/p&gt;

&lt;p&gt;As a key to remember: " useState, the first element of the returned array (recipe in this case) represents the current value of the state variable, while the second element (setRecipe) is a function that allows you to update the state value"&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>On my way!! my coding journey.</title>
      <dc:creator>Kelvin Acosta</dc:creator>
      <pubDate>Mon, 15 May 2023 02:52:45 +0000</pubDate>
      <link>https://dev.to/kelvinacosta/on-my-way-my-coding-journey-1gda</link>
      <guid>https://dev.to/kelvinacosta/on-my-way-my-coding-journey-1gda</guid>
      <description>&lt;p&gt;I was working on my first project in my life. This is the first time I was actually doing code by myself. Meaning that I used to see code since I was 19 but I never paid fully attention to it. I usually just coded to pass the class but I never really put effort on it. I had a super little basic knowledge of syntax before I enjoyed FlatIron.&lt;br&gt;
I enrolled to this amazing bootcamp because I have friends who actually work in this area.&lt;/p&gt;

&lt;p&gt;I did not know what to do for a project until I saw one of my favorite cartoons when I was a kid which it was digimon so I tried to think on what to code. It was like a flash on my head. I remember I used to have digimon cards and I really enjoyed with them.&lt;/p&gt;

&lt;p&gt;A big problem for me was when I had to learn about api. It was a little confusing for me. Before I picked digimon I was checking on all those publics api where they have a lot of data. One of the main reason about getting public digimon api was because it only has name, image and level. It really helped me a lot to understand where and how to use an api. How to really use fetch. The data obtained from an API can be further processed, analyzed, displayed, or utilized in various ways within your application or system.&lt;/p&gt;

&lt;p&gt;Working on my project with api and fetch helped me to understand that are both related to making HTTP requests from a client side application to a server to retrieve data or perform actions which is really cool.&lt;/p&gt;

&lt;p&gt;const digimonContainer = document.getElementById("digimon-container");&lt;/p&gt;

&lt;p&gt;fetch("&lt;a href="https://api.example.com/digimon%22"&gt;https://api.example.com/digimon"&lt;/a&gt;)&lt;br&gt;
  .then(response =&amp;gt; response.json())&lt;br&gt;
  .then(data =&amp;gt; {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const digimons = data;


digimons.forEach(digimon =&amp;gt; {
  const digimonCard = document.createElement("div");
  digimonCard.classList.add("digimon-card");

  const digimonName = document.createElement("h2");
  digimonName.textContent = digimon.name;

  const digimonImage = document.createElement("img");
  digimonImage.src = digimon.image;

  const digimonLevel = document.createElement("p");
  digimonLevel.textContent = `Level: ${digimon.level}`;

  digimonCard.appendChild(digimonName);
  digimonCard.appendChild(digimonImage);
  digimonCard.appendChild(digimonLevel);

  digimonContainer.appendChild(digimonCard);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;})&lt;br&gt;
  .catch(error =&amp;gt; {&lt;br&gt;
        console.error("Error:", error);&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;This code only get Digimon api and returns an array of Digimon objects.Each object contains properties like name, image, and level. It makes a GET request to the api endpoint using fetch, processes the retrieved JSON data, and it creates HTML elements to display the digimon information on the page.&lt;br&gt;
I am excited to keep going on this journey and share my experiences with you. I want to keep learning and I will be keep posting about my coding journey.&lt;/p&gt;

</description>
      <category>api</category>
      <category>javascript</category>
      <category>fetching</category>
    </item>
  </channel>
</rss>
