<?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: Joao Polo</title>
    <description>The latest articles on DEV Community by Joao Polo (@joaozitopolo).</description>
    <link>https://dev.to/joaozitopolo</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%2F81625%2F832d0f25-de52-4cde-9a2f-e634924b9da4.jpeg</url>
      <title>DEV Community: Joao Polo</title>
      <link>https://dev.to/joaozitopolo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joaozitopolo"/>
    <language>en</language>
    <item>
      <title>Then... What the Senior Engineers do?</title>
      <dc:creator>Joao Polo</dc:creator>
      <pubDate>Sat, 04 Sep 2021 23:03:35 +0000</pubDate>
      <link>https://dev.to/joaozitopolo/then-what-the-senior-engineers-do-2b1a</link>
      <guid>https://dev.to/joaozitopolo/then-what-the-senior-engineers-do-2b1a</guid>
      <description>&lt;p&gt;Well, they &lt;strong&gt;code&lt;/strong&gt;... When it's possible, of course.&lt;/p&gt;

&lt;p&gt;But the focus is to list some required tasks, and let you find if to be a Senior is your next job of dreams.&lt;/p&gt;

&lt;p&gt;I found mainly three types of specialization in several companies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The Problem Solver:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As a Senior, you'll use the experience in several projects to solve daily challenges, looking for the product and environment requirements.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;The Tech Lead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this case, your experience will help the product performance, team communication and technical decisions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;The Teacher:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some companies in a fast growth process uses the Senior experience to improve the new workers, helping a common knowledge and a culture. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are other specializations, but it's distributed mainly in &lt;em&gt;technology&lt;/em&gt;, &lt;em&gt;people&lt;/em&gt; or &lt;em&gt;business&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Important to know: You DON'T need to be a solver, a tech lead and a teacher at same time. But you need to try to investigate your next job about what is expected from you. Don't enter in a company only for money, it's important to be happy also.&lt;/p&gt;

&lt;p&gt;But, if you need to grow, but to be Senior is not exactly your dream? You can prepare a new career as a Product Owner (business), an Architect (technology), a Scrum Master (people), etc. Try to identify what area move your head, and go.&lt;/p&gt;

&lt;p&gt;Let's talk about it?&lt;/p&gt;

</description>
      <category>senior</category>
      <category>business</category>
      <category>technology</category>
      <category>people</category>
    </item>
    <item>
      <title>TypeScript - Enum to Array</title>
      <dc:creator>Joao Polo</dc:creator>
      <pubDate>Mon, 16 Aug 2021 19:18:04 +0000</pubDate>
      <link>https://dev.to/joaozitopolo/typescript-enum-to-array-42jg</link>
      <guid>https://dev.to/joaozitopolo/typescript-enum-to-array-42jg</guid>
      <description>&lt;p&gt;I'm working with some enums to ensure the typing for my models. But now, I needed to create a select box with that. I'll explain how to do that.&lt;/p&gt;

&lt;p&gt;Considering a key/value enum, you can use the Object.entries to extract the data and create the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;enum&lt;/span&gt; &lt;span class="nx"&gt;EventModel&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;REPAIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Repair&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;PREVENT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Prevent&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;EventModelList&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;EventModel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(([&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So cool... but, if you have an enum without key=value association?&lt;/p&gt;

&lt;p&gt;In this case, you need to get the values and filter only strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;enum&lt;/span&gt; &lt;span class="nx"&gt;OtherModel&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;MODEL_A&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MODEL_B&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;OtherModelList&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;OtherModel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;It was necessary because each value without an association generates two values: the key itself and the value (a number).&lt;/p&gt;

&lt;p&gt;I created a simple sandbox to test that: &lt;a href="https://codesandbox.io/s/ts-enum-as-array-7f9f6?file=/src/index.ts"&gt;codesandbox:ts-enum-as-array&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>react</category>
    </item>
  </channel>
</rss>
