<?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: Christopher Kade</title>
    <description>The latest articles on DEV Community by Christopher Kade (@christopherkade).</description>
    <link>https://dev.to/christopherkade</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%2F55600%2Fba50a666-cf29-4825-b3ff-ba6467b492de.jpeg</url>
      <title>DEV Community: Christopher Kade</title>
      <link>https://dev.to/christopherkade</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/christopherkade"/>
    <language>en</language>
    <item>
      <title>4 signs you’re over-engineering ⚓️</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Tue, 10 Jan 2023 16:52:40 +0000</pubDate>
      <link>https://dev.to/christopherkade/4-signs-youre-over-engineering-1g8l</link>
      <guid>https://dev.to/christopherkade/4-signs-youre-over-engineering-1g8l</guid>
      <description>&lt;p&gt;During my first years as a Software Engineer I consulted for firms of different sizes (from 20+ to 5000+ people) and it exposed me to various levels of over-engineering. This can happen for a &lt;strong&gt;lot&lt;/strong&gt; of reasons and is usually a collective issue that tends to get worse as time goes on.&lt;/p&gt;

&lt;p&gt;This short list goes into some concrete(ish) examples of pitfalls and how to avoid them. Of course, this list in non-exhaustive and can be improved upon, so feel free to let me know if I’ve missed any glaring signs of this issue !&lt;/p&gt;

&lt;h2&gt;
  
  
  1. You always go for 100% test coverage 🧪
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://en.wikipedia.org/wiki/Pareto_principle" rel="noopener noreferrer"&gt;Pareto Principle&lt;/a&gt; states that 80% of the consequences come from 20% of causes. In our case, the majority of our coverage will be done with a limited amount of tests, and the remaining percentage might take a lot of effort for little reward.&lt;/p&gt;

&lt;p&gt;I recommend reading about the &lt;a href="https://www.etestware.com/7-principles-of-testing/" rel="noopener noreferrer"&gt;ISTQB testing principles&lt;/a&gt;, the second of which states that exhaustive testing is impossible.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One of the most important skills a testing expert possesses is the ability to identify the most important functions to test.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. You have excessive indirection and abstraction in your code 🚩
&lt;/h2&gt;

&lt;p&gt;Have you ever been confronted with a bug in production, felt the rush of adrenaline while trying to fix it as quickly as possible and not being able to pin point where the exact source of the problem is? Did you have to go through layers upon layers of files, wondering why previous authors (yourself included) hid away details by placing them in some external function, four layers deep?&lt;/p&gt;

&lt;p&gt;This is not as much of a problem when building a feature, as you’re focused on creating code that is clean and reusable, but it requires a lot more mental gymnastics when trying to understand it when you’re not the original author. Over abstraction can create unmaintainable &amp;amp; untestable monoliths, that’s why I believe writing concrete code first and then abstracting is important.&lt;/p&gt;

&lt;p&gt;If you ever review code and can’t understand the underlying business logic within, that should already raise a red flag.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Always remember the Rule of Threes: an abstraction without at least three usages isn’t an abstraction. Good abstraction are extracted and not designed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. You use micro-frontends wherever, whenever 🧩
&lt;/h2&gt;

&lt;p&gt;Micro-frontends (dividing parts of your application into smaller, self-contained units) can be beneficial in terms of DX &amp;amp; performance, as it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allows you to only build the relevant part of your application in your CI, making it faster&lt;/li&gt;
&lt;li&gt;Allows you to ship parts of your app using different tech stacks&lt;/li&gt;
&lt;li&gt;Allows to load only the relevant files to your client, making your application more performant&lt;/li&gt;
&lt;li&gt;Allows teams to work independently in a "standalone” version and iterate faster on features&lt;/li&gt;
&lt;li&gt;And many more advantages I won’t get into ! I recommend &lt;a href="https://semaphoreci.com/blog/microfrontends" rel="noopener noreferrer"&gt;this article&lt;/a&gt; if you want to dive deeper.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With all these benefits, why would it be a bad idea to use this architecture too quickly?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Can add complexity and little reward:&lt;/strong&gt; Ask yourself: what are the concrete benefits to using them for our project specifically? Does your project have a lot of independent moving parts?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can add little to no benefits for a lot of work:&lt;/strong&gt; Setting up an MFE takes a lot of configuration &amp;amp; work side-by-side with your infrastructure team.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can increase the size of your payloads:&lt;/strong&gt; if you have a diversity of technology stacks used, it may end up slowing down your user’s experience. This can manifest through duplication of common dependencies - let’s say two of your MFEs use React, you’d then have to download the dependency twice. A solution to that issue would be to use the same version of that dependency across your MFE, but that would introduce a form of build-time coupling of our MFEs which goes against a huge benefit mentioned above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Makes it harder to test your features:&lt;/strong&gt; Here’s an example: say a banner on your homepage appears only when the user navigates to it from their profile, if both of these pages are individual MFEs, then you’d have a hard time reproducing that behavior locally as you’d probably be working on a standalone version of any given page.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The general ideas here also apply to micro-services, but I recommend &lt;a href="https://stackoverflow.blog/2020/11/23/the-macro-problem-with-microservices/" rel="noopener noreferrer"&gt;this article&lt;/a&gt; if you want more information on the subject.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4. Ignoring the YAGNI principle (You Aren’t Gonna Need It) 🙅
&lt;/h2&gt;

&lt;p&gt;The YAGNI principle (created as part of Extreme Programming by Ron Jeffries) states that a feature should only be developed when required and not by anticipation. The main point being that developers should not waste time on creating extraneous elements that may not be necessary and can hinder or slow the development process.&lt;/p&gt;

&lt;p&gt;If you try to future proof your code all the time, you’ll end up more often than not with unused code gathering dust in your repository.&lt;/p&gt;

&lt;p&gt;Let’s say you need to declare a class &lt;code&gt;User&lt;/code&gt; that has a method &lt;code&gt;getAllUsers&lt;/code&gt;, you might start thinking that you’ll eventually need &lt;code&gt;getUserById&lt;/code&gt; and &lt;code&gt;getUserByEmail&lt;/code&gt; and code them right away. But that’s when YAGNI comes in - you should probably reconsider it and only code it when a feature requires it, and for a couple of reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The requirements might change in the future and make you update already unused methods&lt;/li&gt;
&lt;li&gt;The methods might simply never be used and take up space for no reason&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Just like other programming principle (KISS, DRY etc.), YAGNI is pretty straight forward&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;This list was inspired by &lt;a href="https://twitter.com/housecor/status/1607412976876666880" rel="noopener noreferrer"&gt;this tweet&lt;/a&gt; from Cory House, I recommend going through it as it'll show you some other mistakes that can cause over-engineering.&lt;/p&gt;

&lt;p&gt;Have you every been faced with obvious over-engineering in a previous project or jobs? I’d love to hear some of your stories !&lt;/p&gt;

&lt;p&gt;Thanks for reading, I hope you got something out of this list 😄. And feel free to follow me on &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, I'm always happy seeing my circle of dev friends grow 🥰&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>webdev</category>
      <category>softwareengineering</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Optimize your data fetching with React Query ⚛️</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Fri, 23 Dec 2022 14:27:02 +0000</pubDate>
      <link>https://dev.to/christopherkade/introduction-to-react-query-in-2023-537</link>
      <guid>https://dev.to/christopherkade/introduction-to-react-query-in-2023-537</guid>
      <description>&lt;p&gt;I’ve been introduced to React Query at work last year and I wouldn’t be the first to say that it was a bit jarring initially. For the sake of personal growth, let’s document an introduction to it with actual use cases !&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The complete Codesandbox with examples is available &lt;a href="https://codesandbox.io/s/react-query-seh4sj" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What’s React Query?
&lt;/h2&gt;

&lt;p&gt;React Query is a library for managing asynchronous data in React applications. It helps with tasks such as fetching, caching &amp;amp; updating data.&lt;/p&gt;

&lt;p&gt;At a high level, React Query works by providing a set of hooks that can be used to fetch and manage data. These hooks allow developers to declaratively specify the data that their components need, and React Query takes care of the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chris, show me an example please 😬
&lt;/h2&gt;

&lt;p&gt;Here it is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useQuery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;BasicExample&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fetch-user-example&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://random-data-api.com/api/v2/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&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;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;An error occurred: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Basic example of data fetching&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Random user: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;strong&gt;&lt;code&gt;useQuery&lt;/code&gt;&lt;/strong&gt; hook is used to fetch data from the &lt;strong&gt;&lt;code&gt;/api/v2/users&lt;/code&gt;&lt;/strong&gt; endpoint. The hook takes two arguments: a key and a function that returns a promise. The key is used to uniquely identify the data being fetched, and the function is responsible for making the network request and returning a promise that resolves with the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What other cool things can React Query do?
&lt;/h2&gt;

&lt;p&gt;React Query is so much more than just a request framework it offers a lot of tools such as &lt;strong&gt;caching, refetching, pre-fetching &amp;amp; pagination&lt;/strong&gt;. Let’s go over them one by one and see why they might justify using this library.&lt;/p&gt;

&lt;h3&gt;
  
  
  Caching
&lt;/h3&gt;

&lt;p&gt;One of the key features of React Query is its ability to cache data. When a component makes a request for data using one of the React Query hooks, the library will first check its cache to see if the data is already available. If it is, React Query will return the cached data immediately, eliminating the need to make a network request. This can greatly improve the performance of an application, especially when dealing with data that doesn't change very frequently (for example, on an online training platform offering static courses).&lt;/p&gt;

&lt;h3&gt;
  
  
  Refetching
&lt;/h3&gt;

&lt;p&gt;React Query allows you to refetch data when certain conditions are met, such as when a component is re-rendered or when the user navigates to a new page. This helps ensure that data is always up-to-date and consistent across your application.&lt;/p&gt;

&lt;p&gt;Let’s take our previous example and check out how it works in action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useQuery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Refetching&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// The hook returns a refetch method that can be called anytime&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;refetch&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;refetch-user-example&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://random-data-api.com/api/v2/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleRefetch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;refetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;An error occurred: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Refetching&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"wrapper"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Random user: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleRefetch&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Refetch&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pre-fetching
&lt;/h3&gt;

&lt;p&gt;Let’s say your user might need certain data soon, then you can use React Query’s pre-fetching functionality to optimize the performance of your application. This way you can show it almost instantly to your user once they will actually need it.&lt;/p&gt;

&lt;p&gt;Once more, let’s build up our example with pre-fetching:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useQueryClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Prefetching&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;showData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setShowData&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;queryClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQueryClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt; &lt;span class="o"&gt;=&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://random-data-api.com/api/v2/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;prefetch-user-example&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;fetchData&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&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="c1"&gt;// Data will be prefetched here once the component is mounted&lt;/span&gt;
    &lt;span class="nx"&gt;queryClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prefetchQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;prefetch-user-example&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt;&lt;span class="p"&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;queryClient&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;An error occurred: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Prefetching&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setShowData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Show prefetched data&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;showData&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pagination
&lt;/h3&gt;

&lt;p&gt;What if you want infinite scrolling or pagination for your website? When working with large datasets it’s often impractical (and downright not recommended, depending on your use case) to load all the data at once. React Query makes it easy to paginate data and load new pages as needed, while also providing the ability to infinitely scroll through large datasets.&lt;/p&gt;

&lt;p&gt;Here’s what a basic example would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useQuery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setPage&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pagination-example&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;],&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/my-data?page=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;keepPreviousData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleNextClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handlePrevClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;An error occurred: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handlePrevClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          Previous
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleNextClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hasMore&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          Next
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rapid fire of other cool React Query features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Refetch on window focus (using the &lt;code&gt;refetchOnWindowFocus&lt;/code&gt; option, that's &lt;code&gt;true&lt;/code&gt; by default)&lt;/li&gt;
&lt;li&gt;Cache invalidation, you can specify when the data is stale and should be refetched&lt;/li&gt;
&lt;li&gt;Mutation functions, using a set of helper functions to create, update and delete data&lt;/li&gt;
&lt;li&gt;Error handling using the &lt;code&gt;onError&lt;/code&gt; callback or the error object returned by the query&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Are there any risks when using React Query?
&lt;/h3&gt;

&lt;p&gt;As with any framework out there, there's always the risk of introducing additional complexity to your codebase. React Query provides a lot of features and options for managing asynchronous data, and it can be tempting to use them all in an effort to optimize your application. However, this can lead to code that is difficult to understand and maintain, especially if you have multiple developers working on the same codebase.&lt;/p&gt;

&lt;p&gt;Another risk to consider is the possibility of introducing performance issues. While React Query can greatly improve the performance of your application, make sure to use it correctly in order to avoid introducing new performance issues. For example, if you're using the &lt;strong&gt;&lt;code&gt;keepPreviousData&lt;/code&gt;&lt;/strong&gt; option to paginate data, it's important to use a cache key that's specific enough to avoid caching unrelated data. If you're not careful, you may end up with a large cache that negatively impacts the performance of your project.&lt;/p&gt;

&lt;p&gt;Just like any other library out there, it’s important to weigh the benefits and risks it may offer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Overall, React Query is a powerful tool for managing asynchronous data in React applications. Its caching and lifecycle management features make it easy to build performant and scalable applications, and its support for pagination and infinite scrolling make it well-suited for working with large datasets.&lt;/p&gt;

&lt;p&gt;Once you get the hang of it, it's a very potent tool to add to your toolbelt and I hope this quick article pushed you over the edge to try it out.&lt;/p&gt;

&lt;p&gt;As always I'd &lt;strong&gt;love&lt;/strong&gt; to stay in touch on &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; (which surprisingly, hasn't imploded yet) so feel free to connect with me there.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Creating a custom CSS loader of a Yu-Gi-Oh card flipping 🃏</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Wed, 07 Dec 2022 21:03:41 +0000</pubDate>
      <link>https://dev.to/christopherkade/creating-a-custom-css-loader-of-a-yu-gi-oh-card-flipping-3d7m</link>
      <guid>https://dev.to/christopherkade/creating-a-custom-css-loader-of-a-yu-gi-oh-card-flipping-3d7m</guid>
      <description>&lt;p&gt;You read that right, it's time to bring out your Blue Eyes White Dragon and d-d-d-d-deliver some nice animations to your side projects. Bear with me while I revisit my childhood please, and in the meantime, let's have some fun with CSS 🥰&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you wish to jump right into the solution, here's the &lt;a href="https://codesandbox.io/s/hopeful-worker-icrcnh?file=/index.html" rel="noopener noreferrer"&gt;Codesandbox link&lt;/a&gt;, enjoy !&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnusrv418m4kafficsvjj.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnusrv418m4kafficsvjj.gif" alt="The animation taught in this post" width="135" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create the wrapper 🎁
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card-wrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

 &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Our&lt;/span&gt; &lt;span class="nt"&gt;card&lt;/span&gt; &lt;span class="nt"&gt;flip&lt;/span&gt; &lt;span class="nt"&gt;animation&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;simply&lt;/span&gt; &lt;span class="nt"&gt;rotates&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt; &lt;span class="nt"&gt;on&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;Y&lt;/span&gt; 
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;axis&lt;/span&gt; &lt;span class="nt"&gt;and&lt;/span&gt; &lt;span class="nt"&gt;then&lt;/span&gt; &lt;span class="nt"&gt;goes&lt;/span&gt; &lt;span class="nt"&gt;back&lt;/span&gt; &lt;span class="nt"&gt;to&lt;/span&gt; &lt;span class="nt"&gt;its&lt;/span&gt; &lt;span class="nt"&gt;original&lt;/span&gt; &lt;span class="nt"&gt;state&lt;/span&gt;
&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;cardFlip&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rotateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rotateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;180deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rotateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.card-wrapper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transform-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;preserve-3d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cardFlip&lt;/span&gt; &lt;span class="m"&gt;3s&lt;/span&gt; &lt;span class="n"&gt;ease-in-out&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;150px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here &lt;code&gt;transform-style&lt;/code&gt; defines each children element as 3D. When used in conjunction with &lt;code&gt;backface-visibility&lt;/code&gt; and &lt;code&gt;transform&lt;/code&gt;, it will allow us to use the back and front as tangible 3D objects that can be rotated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create each card face 🎴
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card-wrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"front.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card card-back"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"back.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;backface-visibility&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;150px&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="nt"&gt;By&lt;/span&gt; &lt;span class="nt"&gt;default&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;we&lt;/span&gt; &lt;span class="nt"&gt;rotate&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;back&lt;/span&gt; &lt;span class="nt"&gt;of&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;card&lt;/span&gt; &lt;span class="nt"&gt;out&lt;/span&gt; &lt;span class="nt"&gt;of&lt;/span&gt; &lt;span class="nt"&gt;view&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;This&lt;/span&gt; &lt;span class="nt"&gt;way&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;when&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;animation&lt;/span&gt; &lt;span class="nt"&gt;triggers&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;front&lt;/span&gt; &lt;span class="nt"&gt;and&lt;/span&gt; &lt;span class="nt"&gt;back&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;swap&lt;/span&gt; &lt;span class="nt"&gt;places&lt;/span&gt; &lt;span class="nt"&gt;back&lt;/span&gt; &lt;span class="nt"&gt;and&lt;/span&gt; &lt;span class="nt"&gt;forth&lt;/span&gt;
&lt;span class="nc"&gt;.card-back&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rotateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;180deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;backface-visibility&lt;/code&gt; defines the back of the card as hidden by default, this way, when it turns, we won't simply see the same face twice.&lt;/p&gt;




&lt;p&gt;And that's it, short and sweet.&lt;br&gt;&lt;br&gt;
I struggled a bit to implement it at first and figured it would be worth documenting !&lt;br&gt;&lt;br&gt;
Whether you play Magic: the Gathering, Yu-Gi-Oh!, Flesh and Blood, Vanguard or any other TCG, I'm sure you'll find that animation a bit nostalgic.&lt;/p&gt;




&lt;p&gt;Feel free to follow me on &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; (if it's still around by the time you read this article) - it's always fun chatting with some of you and sharing tips &amp;amp; tricks together 😄&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Goodbye Typescript, hello native typing for Javascript ✨</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Wed, 30 Nov 2022 11:09:29 +0000</pubDate>
      <link>https://dev.to/christopherkade/goodbye-typescript-hello-native-typing-for-javascript-3ee1</link>
      <guid>https://dev.to/christopherkade/goodbye-typescript-hello-native-typing-for-javascript-3ee1</guid>
      <description>&lt;p&gt;Typing. Love it or hate it, it has many advantages: better DX (through intellisense auto-completion), better code  documentation, less time consuming errors. Its benefits greatly outweigh its cost, so why do some people still avoid it? One word: &lt;strong&gt;Typescript&lt;/strong&gt;. You have to set it up and make sure your tooling is working correctly which can add a layer of frustration to any project.&lt;/p&gt;

&lt;p&gt;So what if I told you that native typing might be coming to Javascript? Christmas is right around the corner and boy do I have a gift for you 🎅&lt;/p&gt;

&lt;h2&gt;
  
  
  The proposal 📄
&lt;/h2&gt;

&lt;p&gt;TC39 is the comity in charge of Javascript's specs - they help maintain and evolve the definition of JS. If you're curious, I wrote a section about them in a &lt;a href="https://dev.to/christopherkade/the-future-of-javascript-features-to-keep-an-eye-on-3d0h"&gt;previous article&lt;/a&gt;.&lt;br&gt;
They recently moved the &lt;a href="https://github.com/tc39/proposal-type-annotations" rel="noopener noreferrer"&gt;Type Annotations proposal&lt;/a&gt; to Stage 1 (out of 4), which means it's time to widely speculate on the impact and implications of this feature !&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As much as I love being dramatic, this will &lt;strong&gt;not&lt;/strong&gt; sign the death of TS by any means, it will simply allow for cleaner and more reliable JS code for projects that don't plan on using TS or that wish to use both in conjunction.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  What will native JS typing look like if this proposal passes?
&lt;/h2&gt;

&lt;p&gt;It would be very close to what we currently have with Typescript and Flow, namely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// both parameters are numbers, and this method returns a number&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These annotations will not stop you from passing a string or any other variable type as parameter. They will be ignored at runtime and are just there as guidelines that can be used by 3rd party type checkers such as your IDE.&lt;/p&gt;

&lt;p&gt;The argument for strict typing has its place in this discussion in my opinion. In its current proposal, these types are &lt;em&gt;just&lt;/em&gt; type annotations, which is something we already have thanks to JSDoc. So the question remains: why?&lt;/p&gt;

&lt;h2&gt;
  
  
  What's the point? 🤷
&lt;/h2&gt;

&lt;p&gt;We're in an odd situation: Javascript is one of the only languages that has us write in one language (Typescript) to then have it transpiled to another one (Javascript). These layers add complexity to any project, so the more tools we add to our &lt;em&gt;default&lt;/em&gt; tool belt, the better.&lt;/p&gt;

&lt;p&gt;The need for Typescript creates a form of monopoly on current available tooling, where each and everyone of them needs to evolve with TS in order to not be left behind. The &lt;a href="https://octoverse.github.com/2022/top-programming-languages" rel="noopener noreferrer"&gt;State of the Octoverse 2022&lt;/a&gt; shows the impressive popularity of Typescript in 2022, which means this need to evolve becomes almost mandatory for your linters, bundlers etc.&lt;/p&gt;

&lt;p&gt;Having this feature already bundled with our dear Javascript will only make it a more complete package and help us slow down the obvious tooling bloat we're currently facing.&lt;/p&gt;




&lt;p&gt;What do you think? Would you see yourself using this feature if it releases? What are the risks that come to mind, especially if you're an avid user of Typescript?&lt;/p&gt;

&lt;p&gt;Feel free to follow me on &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; (if it doesn't implode by the time you finish this article), it's always a pleasure connecting with some of you 😄&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>The dangers of async/await</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Thu, 16 Jan 2020 13:24:01 +0000</pubDate>
      <link>https://dev.to/christopherkade/the-dangers-of-async-await-3p5g</link>
      <guid>https://dev.to/christopherkade/the-dangers-of-async-await-3p5g</guid>
      <description>&lt;p&gt;After a few months consulting on the rewriting of a large-scale application, I've come to realize that &lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; was used de facto for most asynchronous operation and parallel executions seemed to be out of the picture. For example, consider this Vue code snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;initStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkRussianContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBasket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedCurrency&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;options/fetchOptions&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="na"&gt;basket&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;basket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
 &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, each line of code is executed &lt;strong&gt;when its predecessor is completed&lt;/strong&gt;. Meaning &lt;code&gt;getUser&lt;/code&gt; will wait for &lt;code&gt;getConfig&lt;/code&gt; to finish fetching data before being executed.&lt;br&gt;&lt;br&gt;
Here are a few points that come to mind when seeing this snippet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What if one line does not need data from the previous one? Why block its execution and slow down our application? &lt;/li&gt;
&lt;li&gt;Could we run unrelated methods in parallel using something like &lt;code&gt;Promise.all&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;Related methods should probably be using a &lt;code&gt;then&lt;/code&gt; block to avoid blocking the rest of the method&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The point this article will be to help you catch this &lt;a href="https://en.wikipedia.org/wiki/Code_smell" rel="noopener noreferrer"&gt;code smell&lt;/a&gt; by showing you that using &lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; by default in some cases can have a drastic impact on performance and UX.&lt;/p&gt;
&lt;h2&gt;
  
  
  Unrelated queries should be executed in parallel
&lt;/h2&gt;

&lt;p&gt;Let's see some concrete data, shall we?&lt;/p&gt;

&lt;p&gt;Here's the code snippet we'll be analyzing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getUserData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &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="c1"&gt;// Get a random dog as our user's avatar&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://dog.ceo/api/breeds/image/random&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="c1"&gt;// Get our user's general data&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://randomuser.me/api/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running this snippet 100 times on fast 3G (using Chrome's dev tools), the average execution time is &lt;strong&gt;1231.10ms&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But why block the second query when it doesn't need the result of the first?  Let's change our code to the following and re-run it 100 times.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getUserDataFaster&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &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="c1"&gt;// Execute both requests in parallel&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://dog.ceo/api/breeds/image/random&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
    &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://randomuser.me/api/&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()])&lt;/span&gt;

  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We now have an average execution time of &lt;strong&gt;612.50ms&lt;/strong&gt;, half the time needed when both queries were executed one after the other.&lt;/p&gt;

&lt;p&gt;The point is: if you can execute time-consuming queries in parallel, do it.&lt;/p&gt;

&lt;p&gt;Try it out yourself on this &lt;a href="https://codepen.io/christopherkade/pen/bGNjMeP?editors=1010" rel="noopener noreferrer"&gt;codepen&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unrelated code should not have to wait
&lt;/h2&gt;

&lt;p&gt;Let's take my first example but with a twist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;initStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
     &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
     &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
     &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkRussianContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;])&lt;/span&gt;

   &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBasket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedCurrency&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

   &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;options/fetchOptions&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="na"&gt;basket&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;basket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;initBooking&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
 &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the first 3 requests are executed in parallel, whereas the next ones rely on data fetched beforehand and will therefore be executed afterwards. Although this snippet poses a problem, did you spot it?&lt;/p&gt;

&lt;p&gt;Poor little &lt;code&gt;initBooking&lt;/code&gt; will have to wait for both &lt;code&gt;getBasket&lt;/code&gt; and &lt;code&gt;fetchOptions&lt;/code&gt; to finish before executing even though it has nothing to do with the data they'll fetch.&lt;br&gt;&lt;br&gt;
An easy solution is to trade the &lt;code&gt;await&lt;/code&gt; with a simple &lt;code&gt;then&lt;/code&gt; block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;initStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkRussianContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBasket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedCurrency&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &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="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;options/fetchOptions&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="na"&gt;basket&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;basket&lt;/span&gt;&lt;span class="p"&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;await&lt;/span&gt; &lt;span class="nf"&gt;initBooking&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
 &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, both &lt;code&gt;getBasket&lt;/code&gt; and &lt;code&gt;initBooking&lt;/code&gt; will be executed alongside one another.&lt;/p&gt;

&lt;p&gt;Want to see it for yourself? Check out this &lt;a href="https://codepen.io/christopherkade/pen/BayOZqV?editors=0010" rel="noopener noreferrer"&gt;codepen&lt;/a&gt; illustrating my example.&lt;/p&gt;

&lt;p&gt;I'll stop the article there so I don't overload you with examples, but you should get the gist of it by now.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; are wonderful additions to the Javascript language but I hope you'll now ask yourself if they have their place in the specific method you're working on and more importantly: if some of your queries could be executed in parallel.&lt;/p&gt;

&lt;p&gt;Thank you for reading, I'd love it if you gave me a follow on Twitter &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;@christo_kade&lt;/a&gt;, this way we'll get to share our mutual skepticism towards &lt;code&gt;awaits&lt;/code&gt; ❤️&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Developer health - taking care of yourself as you code</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Wed, 20 Nov 2019 15:36:06 +0000</pubDate>
      <link>https://dev.to/christopherkade/developer-health-taking-care-of-yourself-as-you-code-1hh1</link>
      <guid>https://dev.to/christopherkade/developer-health-taking-care-of-yourself-as-you-code-1hh1</guid>
      <description>&lt;p&gt;I've recently contracted tendonitis in both of my hands, it's nothing major and can be treated of course, but it made me realize how I have been passive about my health as a developer up until then. I'm not talking about going for a run or hitting the gym multiple times a week, but all the other, seemingly little things that can have a major impact on our careers.&lt;br&gt;&lt;br&gt;
Who would've thought: my hands are pretty important to code 🤦‍♂️&lt;/p&gt;

&lt;p&gt;Let's cover a few topics: what you can do right now both &lt;strong&gt;actively&lt;/strong&gt; and &lt;strong&gt;passively&lt;/strong&gt;, and what you can invest in to prevent certain problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Passive behavioral changes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Watch your back posture 📏
&lt;/h3&gt;

&lt;p&gt;Start by sitting all the way back in your chair. If you have good lumbar support it should be rather easy to keep a straight posture. If you tend to forget and end up perched over your screen, try reminding yourself every few minutes until it becomes a habit.&lt;/p&gt;

&lt;p&gt;It's often said that a 90° or 130° angle is good for your back.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rest your forearms on your armrest 💪
&lt;/h3&gt;

&lt;p&gt;And if you don't have any, try to get some !&lt;br&gt;&lt;br&gt;
Your arms should be resting comfortably on your armrests, no pressure should be felt on your shoulders or elbows. If you do feel pressure, adjust the height of your armrests to be &lt;strong&gt;aligned with your desk&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Your arms or wrists should &lt;strong&gt;not&lt;/strong&gt; be pressing on the hard edge of the desk, it should lay there comfortably.&lt;/p&gt;

&lt;h3&gt;
  
  
  Align yourself with your desk 👨‍💻
&lt;/h3&gt;

&lt;p&gt;As mentioned above, you should be aligned with your desk. This was probably my biggest mistake due to a bad chair I had at home: your arms should not be reaching up or down to your work station.&lt;/p&gt;

&lt;p&gt;Additionally, your feet should be resting flat on the ground with your legs at an 90° angle. &lt;/p&gt;

&lt;h3&gt;
  
  
  Position your primary and secondary monitor(s) correctly 🖥
&lt;/h3&gt;

&lt;p&gt;Ideally, your monitor(s) should be at eye height and in front of you, avoiding you to constantly turn your head.&lt;/p&gt;

&lt;p&gt;Working with laptops often means your neck will be at an angle which can create aching over a long period of time. To solve this issue, grab a &lt;a href="https://www.amazon.com/Best-Sellers-Computers-Accessories-Laptop-Stands/zgbs/pc/3015409011" rel="noopener noreferrer"&gt;laptop stand&lt;/a&gt; and add an external keyboard !&lt;/p&gt;

&lt;h3&gt;
  
  
  Position your hands correctly on your keyboard 🤚
&lt;/h3&gt;

&lt;p&gt;I can't stress that enough: your hands should be straight on your keyboard, you shouldn't type diagonally. They should also not be bent over the keyboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grip your mouse correctly 🐭
&lt;/h3&gt;

&lt;p&gt;First off, don't grip it firmly and rest your hand on it, avoid having a talon-like grip. Try to use your whole arm and wrist to move it to allow for larger and stronger muscles to do the work. Finally, try to have your upper arm close into your side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Active behavioral changes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Take. breaks. ⏳
&lt;/h3&gt;

&lt;p&gt;Ideally, you should do a 5-10 minute break every 50 to 60 minutes of work.&lt;br&gt;&lt;br&gt;
I know, this might be infeasible in your current working conditions, but try to sneak in break little by little for the sake of your health.&lt;/p&gt;

&lt;p&gt;If your job requires you to stay for a very long period of time in front of the keyboard, try longer breaks after a longer amount of time, even though the former method is recommended.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stretch your hands 🙆‍♂️
&lt;/h3&gt;

&lt;p&gt;I've found the following &lt;a href="https://www.summitmedicalgroup.com/library/adult_health/sma_wrist_tendonitis_exercises/" rel="noopener noreferrer"&gt;exercises&lt;/a&gt; after finding out I had tendonitis. They allow me to get my hands warmed up and ready to type and only take a few minutes every few hours. You can even pair them up with the breaks mentioned above 🤯&lt;/p&gt;

&lt;p&gt;There are many hand stretches out there, but we often forget to get ourselves ready for work and omit them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Take your time 🐌
&lt;/h3&gt;

&lt;p&gt;I think of myself as a fast typer, but it's sometimes worth it to slow down in order to avoid straining on your hands.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stay hydrated kids 💧
&lt;/h3&gt;

&lt;p&gt;One of the best remedies for tendonitis is water ! So always keep a water bottle near your work station.&lt;/p&gt;

&lt;h2&gt;
  
  
  Investments
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Ergonomic mouse (mice?)
&lt;/h3&gt;

&lt;p&gt;Your average computer mouse is not comfortable and pushes you to have a bad grip over a long perid of time. Ergonomic mouses allow for a comfortable position where your wrist is not twisted. I know it looks weird, but trust me, it works !&lt;br&gt;&lt;br&gt;
Note the pad with a foam support for my wrist 😄, it's worth keeping in mind that some types of wrist rests are not recommended as they can block blood circulation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6nrtvw2t7n9ypb65dg0d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6nrtvw2t7n9ypb65dg0d.jpg" width="560" height="756"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;My own mouse &amp;amp; pad, 17 &amp;amp; 9 € respectively &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Ergonomic keyboard
&lt;/h3&gt;

&lt;p&gt;In order to have an optimal posture on your keyboard, some people recommend purchasing an &lt;a href="https://www.google.com/search?q=ergonomic+keyboard&amp;amp;sxsrf=ACYBGNQsGkahPT8-u5JGU7Hg3r9cVRu-YA:1573632911910&amp;amp;source=lnms&amp;amp;tbm=isch&amp;amp;sa=X&amp;amp;ved=0ahUKEwjaoOK13-blAhVUQxUIHVc8Dw8Q_AUIEigB&amp;amp;biw=1680&amp;amp;bih=829" rel="noopener noreferrer"&gt;ergonomic keyboard&lt;/a&gt;. They apparently take time to get used to (if ever), although I wouldn't know, as I don't have one. But I've heard great things about them so they're worth considering.&lt;/p&gt;

&lt;h3&gt;
  
  
  When needed, purchase hand or wrist braces 🤲
&lt;/h3&gt;

&lt;p&gt;When injured, a wrist brace like the one bellow can be of great help ! It adds pressure on your hand to avoid unecessary movements and allows faster recovery ! It can be found at any sports shop or pharmacies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fclmw7hx74fxwg03npzyx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fclmw7hx74fxwg03npzyx.jpg" width="800" height="1072"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fall style 2019, 10€&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Wrapping things up
&lt;/h2&gt;

&lt;p&gt;Our job/hobby &lt;strong&gt;is&lt;/strong&gt; easy physically, but it doesn't mean we shouldn't watch out and anticipate problems. Health is everything, so take care of yourself and happy coding ! 😄&lt;/p&gt;

&lt;p&gt;If you've learned something or want to help me heal faster, be sure to hit that ❤️ &amp;amp; 🦄 or to bookmark it for future reference ! Otherwise feel free to chat with me &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;@christo_kade&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>18 DevTools for productivity 🚀</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Tue, 05 Nov 2019 09:47:01 +0000</pubDate>
      <link>https://dev.to/christopherkade/18-devtools-for-productivity-5ia</link>
      <guid>https://dev.to/christopherkade/18-devtools-for-productivity-5ia</guid>
      <description>&lt;p&gt;This may sound crazy, but developers are lazy. I know, unbelievable. Some of us are, we need to automate lots of our tasks because repetition can be tiring. So let me show you some tools I find extremely useful, either because they make my life easier or because they push me to write more accessible code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi35u71mg1pc0ghoi7ndq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi35u71mg1pc0ghoi7ndq.gif" width="633" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We've all done it. Type &lt;code&gt;ls&lt;/code&gt; you lazy, lazy person !&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These tools will either be browser/IDE extensions, web apps or CLIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web apps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Bundlephobia
&lt;/h3&gt;

&lt;p&gt;You'd like to use a new dependency but you're not sure if it'll have a major impact performance-wise?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://bundlephobia.com/" rel="noopener noreferrer"&gt;bundlephobia&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Coolors
&lt;/h3&gt;

&lt;p&gt;Looking for a cool color combination for a personal project and you're tired of looking around the room for inspiration?&lt;/p&gt;

&lt;p&gt;️➡️ &lt;a href="https://coolors.co/" rel="noopener noreferrer"&gt;coolors&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Carbon
&lt;/h3&gt;

&lt;p&gt;You'd like to share a code snippet with style for a presentation? (Keep in mind that these pictures are not accessible)&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://carbon.now.sh/" rel="noopener noreferrer"&gt;carbon.now&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Snippet generator
&lt;/h3&gt;

&lt;p&gt;You have a live-coding session and you'd like to use code snippets to be more efficient?&lt;br&gt;&lt;br&gt;
Generate them using this tool &amp;amp; add them to your IDE of choice.&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://snippet-generator.app/?description=My+snippet&amp;amp;tabtrigger=helloWorld&amp;amp;snippet=%3Cdiv%3E%0A++Hello+World+%21%0A%3C%2Fdiv%3E&amp;amp;mode=vscode" rel="noopener noreferrer"&gt;snippet generator&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Wolfram Alpha
&lt;/h3&gt;

&lt;p&gt;You have a complex mathematical problem on your hands? Or a complicated &lt;code&gt;if&lt;/code&gt; statement you'd like to simplify? Input it in this tool and retrieve its truth table, venn diagram &amp;amp; other useful data to make your life easier !&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://www.wolframalpha.com/input/?i=a+or+b+and+b+or+c" rel="noopener noreferrer"&gt;Wolfram Alpha&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DevHints
&lt;/h3&gt;

&lt;p&gt;You keep on forgetting the syntax of that one framework or tool?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://devhints.io" rel="noopener noreferrer"&gt;DevHints&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Caniuse
&lt;/h3&gt;

&lt;p&gt;Want to check if a feature is supported by a specific browser?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://caniuse.com/" rel="noopener noreferrer"&gt;caniuse&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Browser extensions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  headingsMap
&lt;/h3&gt;

&lt;p&gt;Are your headings accessible to screen readers? Do you want to see if your headings are in the wrong place? &lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://chrome.google.com/webstore/detail/headingsmap/flbjommegcjonpdmenkdiocclhjacmbi" rel="noopener noreferrer"&gt;Chrome&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/headingsmap/" rel="noopener noreferrer"&gt;Firefox&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  WCAG Color contrast checker
&lt;/h3&gt;

&lt;p&gt;Looking to avoid contrast problems with your application? Do you want an understanding of which elements of your screen have a bad contrast ratio at a glance? &lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://chrome.google.com/webstore/detail/wcag-color-contrast-check/plnahcmalebffmaghcpcmpaciebdhgdf?hl=en" rel="noopener noreferrer"&gt;Chrome&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/wcag-contrast-checker/" rel="noopener noreferrer"&gt;Firefox&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screencastify
&lt;/h3&gt;

&lt;p&gt;Want to record your web app for a demo? &lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://www.screencastify.com/" rel="noopener noreferrer"&gt;Screencastify&lt;/a&gt; (for Chrome only)&lt;/p&gt;

&lt;h3&gt;
  
  
  Axe
&lt;/h3&gt;

&lt;p&gt;Want to execute automated accessibility tests very easily? (Axe won't test every accessibility concerns you may have, manual testing is also recommended)&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://www.deque.com/axe/" rel="noopener noreferrer"&gt;axe&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  VSCode extensions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Bracket Pair Colorizer
&lt;/h3&gt;

&lt;p&gt;Lost in a forest of &lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2" rel="noopener noreferrer"&gt;Bracket Pair Colorizer&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Git graph
&lt;/h3&gt;

&lt;p&gt;Sick of living in the console for your Git commands?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph" rel="noopener noreferrer"&gt;Git Graph&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GitLens
&lt;/h3&gt;

&lt;p&gt;Want to see who coded what?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens" rel="noopener noreferrer"&gt;GitLens&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Live Share
&lt;/h3&gt;

&lt;p&gt;Want to live-edit a file collectively in your IDE?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare" rel="noopener noreferrer"&gt;Live Share&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  CLIs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ngrok
&lt;/h3&gt;

&lt;p&gt;You're working on a project and want to show your local environment to someone who's not here? &lt;/p&gt;

&lt;p&gt;➡️️ &lt;a href="https://ngrok.com/" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  svgo
&lt;/h3&gt;

&lt;p&gt;Want to optimize your &lt;code&gt;svg&lt;/code&gt; files and remove all the noise?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://github.com/svg/svgo" rel="noopener noreferrer"&gt;svgo&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  tldr
&lt;/h3&gt;

&lt;p&gt;Someone told you to RTFM (as much as I hate this expression) and you despise the usual &lt;code&gt;man&lt;/code&gt; display?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://tldr.sh/" rel="noopener noreferrer"&gt;tldr&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  fkill
&lt;/h3&gt;

&lt;p&gt;Want to kill that pesky process but &lt;code&gt;kill&lt;/code&gt; won't do it?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://github.com/sindresorhus/fkill-cli" rel="noopener noreferrer"&gt;fkill&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  gitmoji CLI
&lt;/h3&gt;

&lt;p&gt;Want to easily commit something following the gitmoji syntax?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://github.com/carloscuesta/gitmoji-cli" rel="noopener noreferrer"&gt;gitmoji CLI&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  gitmoji changelog
&lt;/h3&gt;

&lt;p&gt;Do you wish to generate a beautiful changelog based on your gitmoji commits?&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://github.com/frinyvonnick/gitmoji-changelog" rel="noopener noreferrer"&gt;gitmoji changelog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you've found at least one tool that will make your life easier.&lt;br&gt;
If you'd like to share one of your own, feel free to send them to me on Twitter &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;@christo_kade&lt;/a&gt; or right here in the comments!  &lt;/p&gt;

</description>
      <category>productivity</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Celebrating my 10 000th follower on DEV 🎉</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Tue, 29 Oct 2019 12:58:00 +0000</pubDate>
      <link>https://dev.to/christopherkade/celebrating-my-10-000th-follower-on-dev-1288</link>
      <guid>https://dev.to/christopherkade/celebrating-my-10-000th-follower-on-dev-1288</guid>
      <description>&lt;p&gt;Alright, I know these posts are annoying but I just wanted to express how great this platform is &amp;amp; thank everyone for making it grow so much week after week.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1189133325371359232-205" src="https://platform.twitter.com/embed/Tweet.html?id=1189133325371359232"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1189133325371359232-205');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1189133325371359232&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;I've been able to improve on my technical writing skills &amp;amp; share some things I'm passionate about. Here are some people I look up to, motivating me to improve post after post, either because they teach a whole lot or because they have a positive influence on our community:&lt;/p&gt;


&lt;div class="ltag__user ltag__user__id__38627"&gt;
    &lt;a href="/aspittel" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F38627%2F77a2a5e7-603e-41b4-afcc-f7aff468ae2f.jpg" alt="aspittel image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/aspittel"&gt;Ali Spittel&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/aspittel"&gt;Passionate about education, Python, JavaScript, and code art.&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;div class="ltag__user ltag__user__id__"&gt;
    &lt;div class="ltag__user__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png" alt="[deleted user] image"&gt;
    &lt;/div&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;[Deleted User]&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;div class="ltag__user ltag__user__id__1"&gt;
    &lt;a href="/ben" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1%2Ff451a206-11c8-4e3d-8936-143d0a7e65bb.png" alt="ben image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/ben"&gt;Ben Halpern&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/ben"&gt;A Canadian software developer who thinks he’s funny.&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;div class="ltag__user ltag__user__id__123002"&gt;
    &lt;a href="/samanthaming" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F123002%2Fc9c92442-e0d8-4fb7-837b-e7b0dc7a8494.jpg" alt="samanthaming image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/samanthaming"&gt;Samantha Ming&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/samanthaming"&gt;Frontend Developer sharing weekly JS, HTML, CSS code tidbits 🔥Discover them all on samanthaming.com 💛&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;div class="ltag__user ltag__user__id__22924"&gt;
    &lt;a href="/devdevcharlie" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F22924%2Fd8b205e7-f66a-4d59-b960-ba4c838db516.png" alt="devdevcharlie image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/devdevcharlie"&gt;Charlie Gerard&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/devdevcharlie"&gt;I am a senior developer advocate, passionate about creative coding and building interactive prototypes mixing science, art &amp;amp; technology. I also spend time mentoring, contributing to OSS and speaking.&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;div class="ltag__user ltag__user__id__138665"&gt;
    &lt;a href="/john_papa" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F138665%2Fcee5c68d-3bd2-4042-af64-5214952d6c30.jpg" alt="john_papa image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/john_papa"&gt;John Papa&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/john_papa"&gt;Husband, father, &amp;amp; Catholic enjoying life with my family. Working @ Microsoft. Disney fanatic, web and mobile developer&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Lastly, allow me to list some of my favorite articles I wrote in the last 2 years ❤️&lt;/p&gt;

&lt;p&gt;First off, my latest piece about features to look forward to in Javascript:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/christopherkade" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F55600%2Fba50a666-cf29-4825-b3ff-ba6467b492de.jpeg" alt="christopherkade"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/christopherkade/the-future-of-javascript-features-to-keep-an-eye-on-3d0h" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;The future of Javascript - features to keep an eye on&lt;/h2&gt;
      &lt;h3&gt;Christopher Kade ・ Oct 24 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Thanks to you, I now have an amazing list of tools I use on a weekly basis:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/christopherkade" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F55600%2Fba50a666-cf29-4825-b3ff-ba6467b492de.jpeg" alt="christopherkade"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/christopherkade/what-s-one-resource-most-devs-don-t-know-that-you-use-regularly-5cp5" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;What's one resource most devs don't know that you use regularly?&lt;/h2&gt;
      &lt;h3&gt;Christopher Kade ・ Jun 4 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#discuss&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;One of my most successful articles, about something I was afraid of just a few years ago:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/christopherkade" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F55600%2Fba50a666-cf29-4825-b3ff-ba6467b492de.jpeg" alt="christopherkade"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/christopherkade/up-your-git-game-and-clean-up-your-history-4j3j" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Up your Git game and clean up your history&lt;/h2&gt;
      &lt;h3&gt;Christopher Kade ・ Jun 18 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#git&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Some tips on improving how we write components:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/christopherkade" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F55600%2Fba50a666-cf29-4825-b3ff-ba6467b492de.jpeg" alt="christopherkade"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/christopherkade/writing-elegant-and-resilient-components-547i" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Tips to write elegant and resilient components&lt;/h2&gt;
      &lt;h3&gt;Christopher Kade ・ Aug 8 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;And my very first article on this platform, it's NOT good but I'm glad it started there:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/christopherkade" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F55600%2Fba50a666-cf29-4825-b3ff-ba6467b492de.jpeg" alt="christopherkade"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/christopherkade/defining-quality-requirements-for-a-projects-5ej5" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Defining quality requirements for a project&lt;/h2&gt;
      &lt;h3&gt;Christopher Kade ・ Jan 30 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#requirements&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#agile&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Thanks again ❤️&lt;/p&gt;

</description>
      <category>meta</category>
      <category>writing</category>
    </item>
    <item>
      <title>The future of Javascript - features to keep an eye on</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Thu, 24 Oct 2019 07:33:22 +0000</pubDate>
      <link>https://dev.to/christopherkade/the-future-of-javascript-features-to-keep-an-eye-on-3d0h</link>
      <guid>https://dev.to/christopherkade/the-future-of-javascript-features-to-keep-an-eye-on-3d0h</guid>
      <description>&lt;p&gt;We take a lot of Javascript features for granted, &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, &lt;code&gt;reduce&lt;/code&gt;, &lt;code&gt;const&lt;/code&gt;/&lt;code&gt;let&lt;/code&gt;, ternaries... each one of these had a major impact on our code bases when they were introduced &amp;amp; allow for us to write cleaner and often times more performant code.&lt;/p&gt;

&lt;p&gt;Let's cover who decides on the future of Javascript briefly, and then introduce some features that should arrive in the near &amp;amp; not so near future.&lt;/p&gt;

&lt;p&gt;If you're only interested in concrete features, skip to the next section below by clicking here 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F15229355%2F67385541-94fb3700-f593-11e9-84e3-042ff8a73dee.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F15229355%2F67385541-94fb3700-f593-11e9-84e3-042ff8a73dee.jpg" alt="paul-esch-laurent-oZMUrWFHOB4-unsplash" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ECMA? TC39?
&lt;/h2&gt;

&lt;p&gt;In 1959, computers were being used more and more, which brought in multiple new manufacturers. Something was clear: they needed to find a way to standardize technical operations such as (but not only) programming.&lt;/p&gt;

&lt;p&gt;And so, the 27th of April 1960 in Brussels, the European Computer Manufacturers Association (or ECMA) was born, looking to standardize this mess.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: in 1994, ECMA became ecma international, where they dropped the acronym and used the latter word to show their international scale.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ECMA elects a new president every single year, usually someone from a major actor in computer science: IBM, HP, Siemens, Philips etc. Jochen Friedrick from IBM currently resides as president for the 2018-2019 period.&lt;/p&gt;

&lt;p&gt;Here's how it's structured:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52913438%2F67367591-180d9480-f576-11e9-8386-2eebf29d748b.png" class="article-body-image-wrapper"&gt;&lt;img alt="Screenshot 2019-10-23 at 09 18 17" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52913438%2F67367591-180d9480-f576-11e9-8386-2eebf29d748b.png" width="800" height="544"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The general assembly includes ordinary members of ecma and is its highest authority. It controls its management, secretariat &amp;amp; executive committee. It's currently composed of some of the biggest names in tech, including Apple, AirBnb, Facebook, Netflix &amp;amp; Google. &lt;a href="https://www.ecma-international.org/memento/members.htm" rel="noopener noreferrer"&gt;Full list of members&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's the secretariat's role to organize and create Technical Committees (TCs) and Technical Groups (TGs) who handle specific aspects of computer science.&lt;/p&gt;

&lt;p&gt;Each TC manages the evolution &amp;amp; future of things such as Programming Languages, Product Safety and of course: ECMAScript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52913438%2F67367895-b4379b80-f576-11e9-89a9-b966c4907ea0.png" class="article-body-image-wrapper"&gt;&lt;img alt="Screenshot 2019-10-23 at 09 22 50" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52913438%2F67367895-b4379b80-f576-11e9-89a9-b966c4907ea0.png" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You now have a general overview of how things work, but what's the lifecycle of a new JS feature?&lt;/p&gt;

&lt;h2&gt;
  
  
  TC39 proposals
&lt;/h2&gt;

&lt;p&gt;So TC39 manages the evolution of our beloved (and sometimes hated) language, almost everything they do is &lt;a href="https://github.com/tc39/proposals" rel="noopener noreferrer"&gt;open-sourced&lt;/a&gt; so it's always cool to check out new proposals and how they evolve over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stages of an ECMAScript feature
&lt;/h2&gt;

&lt;p&gt;A new ECMAScript feature goes through 5 stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stage 0&lt;/strong&gt; (Strawperson): which allows initial input into the specification&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 1&lt;/strong&gt; (Proposal): allows to make the case for the addition, describe the shape of the solution &amp;amp; identify potential challenges&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 2&lt;/strong&gt; (Draft): allows to precisely describe the syntax and semantic using formal specification language&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 3&lt;/strong&gt; (Candidate): indicates that further refinement will require feedback from implementations &amp;amp; users. Basically requires that all semantics, syntax and APIs are completely described&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 4&lt;/strong&gt; (Finished): Indicate that the addition is ready for inclusion in the formal ECMAScript standard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can get more information and dive into great details about these stages &lt;a href="https://tc39.es/process-document/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 4 features
&lt;/h2&gt;

&lt;p&gt;Let's get to concrete stage 4 features, meaning features that are finished and that will be included in the soonest practical standard version of ECMAScript. I'll also display their current browser support.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Object.fromEntries&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gw88qeu6gva0qefh46m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gw88qeu6gva0qefh46m.png" alt="Code Snippet Object.fromEntries" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654865%2FScreenshot_2019-10-15_at_09.52.44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654865%2FScreenshot_2019-10-15_at_09.52.44.png" width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Array.flatMap&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyh9o9ih0r9l5sedf0rew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyh9o9ih0r9l5sedf0rew.png" alt="flatMap snippet" width="800" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap" rel="noopener noreferrer"&gt;MDN&lt;/a&gt; docs mention that it's even slightly more efficient.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654881%2FScreenshot_2019-10-15_at_09.53.45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654881%2FScreenshot_2019-10-15_at_09.53.45.png" width="800" height="173"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;BigInt&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futahszx38h8u31yvu42h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futahszx38h8u31yvu42h.png" alt="BigInt snippet" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654894%2FScreenshot_2019-10-15_at_09.54.21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654894%2FScreenshot_2019-10-15_at_09.54.21.png" width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;globalThis&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp8dohy02bvz7iwpmdpb1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp8dohy02bvz7iwpmdpb1.png" alt="globalThis snippet" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654903%2FScreenshot_2019-10-15_at_09.54.53.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654903%2FScreenshot_2019-10-15_at_09.54.53.png" width="800" height="176"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;String.trimStart&lt;/code&gt; &amp;amp; &lt;code&gt;String.trimEnd&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ibv56ry89hh0datvwq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ibv56ry89hh0datvwq3.png" alt="trimStart snippet" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654914%2FScreenshot_2019-10-15_at_09.55.27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654914%2FScreenshot_2019-10-15_at_09.55.27.png" width="800" height="176"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Promise.allSettled&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5c2npqvf33nt2woso7hs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5c2npqvf33nt2woso7hs.png" alt="Promise.allSettled snippet" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654917%2FScreenshot_2019-10-15_at_09.56.01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fmedia-p.slid.es%2Fuploads%2F986999%2Fimages%2F6654917%2FScreenshot_2019-10-15_at_09.56.01.png" width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Stage 3 features
&lt;/h2&gt;

&lt;p&gt;Stage 3 features won't get released in the near future, but some of them are so cool that it's worth mentioning them.&lt;br&gt;&lt;br&gt;
I won't mention their browser support though, as it's not relevant.&lt;/p&gt;



&lt;h3&gt;
  
  
  Optional chaining
&lt;/h3&gt;

&lt;p&gt;This one might be my favorites, bye bye &lt;code&gt;user &amp;amp;&amp;amp; user.name&lt;/code&gt; !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0d25aofvgycpiqv6da2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0d25aofvgycpiqv6da2y.png" alt="Optional chaining snippet" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  Nullish Coalescing
&lt;/h3&gt;

&lt;p&gt;Do you know how Javascript can be weird sometimes? When you need to do some validation with a value equal to 0 but forget that it's considered as falsy?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsxafw5gcbapiym02f2j3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsxafw5gcbapiym02f2j3.png" alt="nullish coalescing snippet" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Did you learn anything new? What feature excites you the most? I'd love to here your thoughts either here or on Twitter &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;@christo_kade&lt;/a&gt; !&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Improving your Git workflow</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Wed, 14 Aug 2019 14:31:38 +0000</pubDate>
      <link>https://dev.to/christopherkade/improving-your-git-workflow-176j</link>
      <guid>https://dev.to/christopherkade/improving-your-git-workflow-176j</guid>
      <description>&lt;p&gt;Whether you are on your own or with a team, having an efficient Git workflow can go a long way to boost your productivity.&lt;br&gt;&lt;br&gt;
For the past month, I've been consulting with a team that truly values the points I'll share with you today, and I've been able to see the positive effects they've had on a large-scale project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1556075798-4825dfaaf498%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D2110%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1556075798-4825dfaaf498%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D2110%26q%3D80" width="800" height="530"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Naming conventions
&lt;/h2&gt;

&lt;p&gt;Git naming conventions are &lt;strong&gt;key&lt;/strong&gt;. They allow you to understand the context of somebody's work in a matter of seconds and can help you filter through your team's work when well executed.&lt;/p&gt;

&lt;p&gt;There isn't a perfect naming convention out there, but some of them, like &lt;a href="https://nvie.com/posts/a-successful-git-branching-model/" rel="noopener noreferrer"&gt;Vincent Driessen's&lt;/a&gt; make a lot of sense and will clarify the mess that can be naming Git branches.&lt;br&gt;&lt;br&gt;
In short, other than your usual &lt;code&gt;master&lt;/code&gt; and &lt;code&gt;dev&lt;/code&gt; branches, your &lt;em&gt;supporting&lt;/em&gt; branches can be of the following types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feature branches&lt;/strong&gt; (&lt;code&gt;feature-*&lt;/code&gt;): takes the form of a user story, or a feature that will be merged later on&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Release branches&lt;/strong&gt; (&lt;code&gt;release-*&lt;/code&gt;): support the preparation of new product release, say a future rebranding of your website and will be eventually merged when ready&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hotfix branches&lt;/strong&gt; (&lt;code&gt;hotfix-*&lt;/code&gt;): your typical bug fix. You could, for example, branch off in order to fix a bug in production&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But naming conventions also apply to &lt;strong&gt;commit messages&lt;/strong&gt;. I truly recommend Chris Beam's &lt;a href="https://chris.beams.io/posts/git-commit/" rel="noopener noreferrer"&gt;"How to Write a Git Commit Message"&lt;/a&gt; in order to grasp the importance of carefully naming your commits. But I think the following guidelines are a good summary:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Separate subject from body with a blank line&lt;/li&gt;
&lt;li&gt;Limit the subject line to 50 characters&lt;/li&gt;
&lt;li&gt;Capitalize the subject line&lt;/li&gt;
&lt;li&gt;Do not end the subject line with a period&lt;/li&gt;
&lt;li&gt;Use the imperative mood in the subject line&lt;/li&gt;
&lt;li&gt;Wrap the body at 72 characters&lt;/li&gt;
&lt;li&gt;Use the body to explain what and why vs. how&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good rule of thumb is to use the sentence: &lt;em&gt;if applied, this commit will...&lt;/em&gt; and end it with your commit's title. If it makes no sense, you might want to reconsider it.&lt;br&gt;&lt;br&gt;
For example: &lt;em&gt;if applied, this commit will remove all deprecated methods&lt;/em&gt; sounds great, whereas &lt;em&gt;if applied, this commit will fix bug #123&lt;/em&gt; doesn't.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: if you're using a tool such as Jira you could incorporate your ticket numbers in both your branch names and commit messages in order to make it easier to cross check.&lt;br&gt;&lt;br&gt;
Also, don't forget that these are just tips, and that at the end of the day you can always follow your own path. We'll all end up with some 'please work' commit messages here and there. 😄&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Github labels
&lt;/h2&gt;

&lt;p&gt;Github labels are another great way of filtering through your pull requests. So here are some labels I've found useful in the past and their meaning (when it isn't obvious):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Good first issue&lt;/strong&gt;: especially great when your project is open-source and looking for new contributors. It's a great entry point for anyone too afraid to help out&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Feature&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bug&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tech&lt;/strong&gt;: means the associated pull request isn't about a client-facing feature. It could be about your project's &lt;code&gt;eslint&lt;/code&gt; or &lt;code&gt;storybook&lt;/code&gt; configurations for example&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Critical&lt;/strong&gt;: helps your team know which PRs are worth reviewing first, especially when on a tight deadline&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Help wanted&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;In progress&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XS&lt;/strong&gt;, &lt;strong&gt;S&lt;/strong&gt;, &lt;strong&gt;M&lt;/strong&gt;, &lt;strong&gt;L&lt;/strong&gt; and &lt;strong&gt;XL&lt;/strong&gt;: represents the size of the PR at a quick glance. It's hard to determine how many lines changed will make up for any of these sizes, it's all up to you&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Review needed&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reviewed&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Labels can be changed by clicking on the following link in your pull requests page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3kjqj2dmbeokhxuf1qn6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3kjqj2dmbeokhxuf1qn6.png" alt="labels link screenshot" width="800" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's now as simple as clicking on "New label", setting a name, optional description and a color.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1dszuk80lujpw6kjl4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1dszuk80lujpw6kjl4v.png" alt="new label screenshot" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Protecting Git branches
&lt;/h2&gt;

&lt;p&gt;You can limit branch manipulation by, for example, enforcing a required status before merging a given branch. This is great when you've set code review rules and don't want anyone to mistakenly merge a branch.&lt;/p&gt;

&lt;p&gt;As admin of a project, go to &lt;code&gt;Settings&lt;/code&gt; =&amp;gt; &lt;code&gt;Branches&lt;/code&gt; =&amp;gt; &lt;code&gt;Add rule&lt;/code&gt; and input the name of the branch you wish to protect.  &lt;/p&gt;

&lt;p&gt;You can chose from a number of rules, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requiring X pull request reviews before merging&lt;/li&gt;
&lt;li&gt;Requiring status checks to pass before merging, great when you have a robust CI process in place&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating Git hooks
&lt;/h2&gt;

&lt;p&gt;I'll quote the &lt;a href="https://githooks.com/" rel="noopener noreferrer"&gt;official docs&lt;/a&gt; for this one:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Git hooks are scripts that Git executes before or after events such as &lt;strong&gt;commit&lt;/strong&gt;, &lt;strong&gt;push&lt;/strong&gt; and &lt;strong&gt;receive&lt;/strong&gt;. Git hooks are a built-in feature - no need to download anything.&lt;/p&gt;

&lt;p&gt;Every Git repository has a .git/hooks folder with a script for each hook you can bind to. You're free to change or update these scripts as necessary, and Git will execute them when those events occur.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'd recommend using awesome tools such as &lt;a href="https://github.com/typicode/husky" rel="noopener noreferrer"&gt;Husky&lt;/a&gt; in order to create them easily.&lt;/p&gt;

&lt;p&gt;Automatically executing your tests and blocking a push if they fail will go a &lt;strong&gt;long way&lt;/strong&gt; to avoid polluting your git history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honorable mentions
&lt;/h2&gt;

&lt;p&gt;I'd like to mention something I use regularaly on personal projects such as &lt;a href="https://github.com/christopherkade/foodpicker" rel="noopener noreferrer"&gt;Foodpicker&lt;/a&gt;, &lt;a href="https://github.com/christopherkade/banner-generator" rel="noopener noreferrer"&gt;Banner Generator&lt;/a&gt; or &lt;a href="https://github.com/christopherkade/gitignore-it" rel="noopener noreferrer"&gt;Gitignore It&lt;/a&gt; (if you're curious, check out their Git history): 🎨 ⚡️ &lt;a href="https://gitmoji.carloscuesta.me/" rel="noopener noreferrer"&gt;Gitmoji&lt;/a&gt; 🔥 🐛! It's a way of codifying your commit messages using emojis, this way you can understand the &lt;strong&gt;context&lt;/strong&gt; of a commit at a glance. Some might dismiss it right away due to its colorful nature, but I've found it very useful to generate changelogs for example.&lt;/p&gt;

&lt;p&gt;Some awesome tools such as &lt;a href="https://github.com/carloscuesta/gitmoji-cli" rel="noopener noreferrer"&gt;gitmoji-cli&lt;/a&gt; and &lt;a href="https://github.com/frinyvonnick/gitmoji-changelog" rel="noopener noreferrer"&gt;gitmoji-changelog&lt;/a&gt; make my Git experience smoother on a daily basis, so make sure to check them out if you're interested !&lt;/p&gt;

&lt;p&gt;I hope you've learned a couple of things reading this article ! As always, I'd love for you to tweet at me &lt;a href="https://twitter.com/christo_kade" rel="noopener noreferrer"&gt;@christo_kade&lt;/a&gt; if you have any questions 😄&lt;br&gt;&lt;br&gt;
Take care, and don't forget: always rebase locally ❤️&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>git</category>
    </item>
    <item>
      <title>Tips to write elegant and resilient components</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Thu, 08 Aug 2019 11:18:26 +0000</pubDate>
      <link>https://dev.to/christopherkade/writing-elegant-and-resilient-components-547i</link>
      <guid>https://dev.to/christopherkade/writing-elegant-and-resilient-components-547i</guid>
      <description>&lt;p&gt;As a Front-end developer, building resilient and reusable components is a top priority of mine, and there are so many arguments in favor of well thought out components.  &lt;/p&gt;

&lt;p&gt;Thankfully, most of today's UI libraries and frameworks go a long way to help you build the best components possible for your projects (and more importantly, for your team). Nevertheless, keeping a few guidelines in mind can help us avoid pitfalls, especially when it comes to large-scale applications.&lt;/p&gt;

&lt;p&gt;In this article, we'll go through concepts I follow everyday that are &lt;strong&gt;library and framework agnostic&lt;/strong&gt;, meaning they apply to UI components as a whole.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Have a modular approach&lt;/li&gt;
&lt;li&gt;Name your components well&lt;/li&gt;
&lt;li&gt;Keep your props simple&lt;/li&gt;
&lt;li&gt;Keep your business logic in container components&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Have a modular approach
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuvlc91zkapui3vvd42xm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuvlc91zkapui3vvd42xm.png" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ideally, your components should follow the &lt;a href="https://addyosmani.com/first/" rel="noopener noreferrer"&gt;FIRST&lt;/a&gt; principle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;F&lt;/strong&gt;ocused: one component, one responsibility, if a component is doing too much, ask yourself if you can extract that logic somewhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I&lt;/strong&gt;ndependent: ideally, a component should not depend on another one to function. Passing simple and straight to the point props can help you create independent elements. If you've ever used &lt;a href="https://storybook.js.org" rel="noopener noreferrer"&gt;Storybook&lt;/a&gt;, think of it that way: &lt;em&gt;Can I extract this component into a story easily?&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;R&lt;/strong&gt;eusable: UI components are lego bricks, they should fit anywhere pretty easily. Once again, a component's reusability is often determined by the simplicity of its props (more on that topic later).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;S&lt;/strong&gt;mall: I was horrified to see components reaching the 1000 lines mark on a project I'm currently consulting on. Keep 👏 them 👏 small. A small component can be read and explained easily and is simpler to test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;T&lt;/strong&gt;estable: &lt;em&gt;How much mocking is required to test this component?&lt;/em&gt; is usually a good question to ask yourself, complex components will require a complex context to mock beforehand. Keeping in mind that the easiest components to test are known as &lt;em&gt;pure components&lt;/em&gt;, meaning that for a given input, the component will always render the same output, produces &lt;strong&gt;no side effects&lt;/strong&gt; and relies on no external mutable states.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Of course, you'll be working on elements that are truly dependant on your business logic, meaning you probably won't be able to follow these guidelines completely, &lt;strong&gt;and that's okay&lt;/strong&gt;. Some components aren't meant to be reusable and some components won't be independent; but keeping this principle in mind is a good start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Name your components well
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7lela74d5seu5wk9777.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7lela74d5seu5wk9777.png" width="800" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I tend to try and keep my component names &lt;strong&gt;short&lt;/strong&gt;, &lt;strong&gt;meaningful&lt;/strong&gt; and &lt;strong&gt;easy to pronounce&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here are some good and bad examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Good --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;user-button&amp;gt;&amp;lt;/user-button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;payment-details&amp;gt;&amp;lt;/payment-details&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;user-card&amp;gt;&amp;lt;/user-card&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- Bad --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;user-btn&amp;gt;&amp;lt;/user-btn&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- hard to pronounce --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;user-guarantee-payment-tab&amp;gt;&amp;lt;/user-guarantee-payment-tab&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- too long --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;ui-dropdown&amp;gt;&amp;lt;/ui-dropdown&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- every component is a UI element, no need to mention it --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Keep your props simple
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3res3ji6ieww60ywefu9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3res3ji6ieww60ywefu9.png" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As mentioned in the first tip, props can make or break a component.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid passing down complex object structures, favour individual attributes as props whenever possible&lt;/li&gt;
&lt;li&gt;Use simple names for your props. We should be able to understand its purpose (even partially) upon reading it &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basically, &lt;strong&gt;try using Javascript primitives&lt;/strong&gt; (strings, numbers, booleans) and functions as props whenever possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep your business logic in container components
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqli5zkkfwdtv3hx2fr2n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqli5zkkfwdtv3hx2fr2n.png" width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Container components&lt;/strong&gt; (such as layouts) should take care of computation and business logic as a whole in order to pass its results as props to &lt;strong&gt;presentational components&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This pattern isn't always valid, but the idea it promotes is important to keep in mind: complex and stateful logic is easier to maintain when kept separate. In the case of a React application for example, this business logic can be extracted in a custom hook, so this "smart/dumb" component pattern really is about separation of concern.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Often times, having each component handle their own logic can lead to them being hard to re-use throughout your application as they will be bound to a specific context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't overdo it
&lt;/h2&gt;

&lt;p&gt;These are just general tips for building efficient components. Of course, each project has different requirements and may not allow for you to follow these guidelines all the time.  &lt;/p&gt;

&lt;p&gt;As Dan Abramov says in his &lt;a href="https://overreacted.io/writing-resilient-components/" rel="noopener noreferrer"&gt;Writing Resilient Components&lt;/a&gt; article: &lt;em&gt;Don’t Get Distracted by Imaginary Problems&lt;/em&gt;. Keep in mind that it's not worth it to over-engineer all of your components and to enforce rules that may not bring meaningful differences.&lt;/p&gt;

&lt;p&gt;I hope this short list will help some of you build better UI components in your day-to-day. As always, if you have any questions, tweet at me &lt;a href="http://twitter.com/christo_kade" rel="noopener noreferrer"&gt;@christo_kade&lt;/a&gt; ❤️&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Introducing Food Picker, the best way to pick what to eat with your colleagues !</title>
      <dc:creator>Christopher Kade</dc:creator>
      <pubDate>Mon, 05 Aug 2019 20:45:23 +0000</pubDate>
      <link>https://dev.to/christopherkade/introducing-food-picker-the-best-way-to-pick-what-to-eat-with-your-colleagues-pmd</link>
      <guid>https://dev.to/christopherkade/introducing-food-picker-the-best-way-to-pick-what-to-eat-with-your-colleagues-pmd</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;It's lunchtime, you look up from your monitor and meet your colleague's gaze, they whisper: &lt;em&gt;sushi&lt;/em&gt;, you whisper back: &lt;em&gt;no way Jose&lt;/em&gt;.&lt;br&gt;&lt;br&gt;
You then share with them a link to &lt;a href="https://foodpicker.club/" rel="noopener noreferrer"&gt;Food Picker&lt;/a&gt;, and both select what you'd like to eat and &lt;strong&gt;BAM&lt;/strong&gt;, an accord was reached: pizza.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This could be you if you used Food Picker with your team, no more debating where to eat, no more tears and anger, only food.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvkb9gzgkfgj4cq2lj6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvkb9gzgkfgj4cq2lj6l.png" alt="Food picker screenshot" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope some of you actually find this useful, otherwise here are some other projects I did recently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A banner generator for DEV ➡️ &lt;a href="https://github.com/christopherkade/banner-generator" rel="noopener noreferrer"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;.gitignore&lt;/code&gt; generator CLI ➡️ &lt;a href="https://github.com/christopherkade/gitignore-it" rel="noopener noreferrer"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you like it, feel free to give it a ⭐️ &lt;a href="https://github.com/christopherkade/foodpicker" rel="noopener noreferrer"&gt;right here&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
