<?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: AlekseiKorolev</title>
    <description>The latest articles on DEV Community by AlekseiKorolev (@alekseikorolev).</description>
    <link>https://dev.to/alekseikorolev</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%2F489054%2F76a79b98-973b-4ce9-a018-19d1592c59b5.png</url>
      <title>DEV Community: AlekseiKorolev</title>
      <link>https://dev.to/alekseikorolev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alekseikorolev"/>
    <language>en</language>
    <item>
      <title>Implement pinch gesture</title>
      <dc:creator>AlekseiKorolev</dc:creator>
      <pubDate>Sat, 04 Sep 2021 15:59:17 +0000</pubDate>
      <link>https://dev.to/alekseikorolev/implement-pinch-gesture-cho</link>
      <guid>https://dev.to/alekseikorolev/implement-pinch-gesture-cho</guid>
      <description>&lt;p&gt;To recognize the gesture, we use two events &lt;code&gt;'touchestart'&lt;/code&gt; and &lt;code&gt;'touchend'&lt;/code&gt;.&lt;br&gt;
&lt;em&gt;Start&lt;/em&gt; will fire first, and we have to check exactly how many touches we need. In this case, two should be enough.&lt;br&gt;
&lt;em&gt;End&lt;/em&gt; will fire twice. The first will contain only one touch data. The second one will be empty.&lt;br&gt;
What we do is save the coordinates of the &lt;em&gt;start&lt;/em&gt; touches and compare them with the &lt;em&gt;end&lt;/em&gt; ones. If the &lt;em&gt;end&lt;/em&gt; touch is outside the range between the &lt;em&gt;start&lt;/em&gt; touches, this means that we are zooming in, otherwise, we are zoomin out.&lt;br&gt;
&lt;a href="https://codepen.io/alekseikorolev/full/ZEypeYw"&gt;Live example&lt;/a&gt; (&lt;em&gt;use on phone&lt;/em&gt;)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Debugging an Angular mobile app</title>
      <dc:creator>AlekseiKorolev</dc:creator>
      <pubDate>Fri, 27 Aug 2021 18:23:41 +0000</pubDate>
      <link>https://dev.to/alekseikorolev/debugging-an-angular-mobile-app-d2</link>
      <guid>https://dev.to/alekseikorolev/debugging-an-angular-mobile-app-d2</guid>
      <description>&lt;p&gt;When working on a mobile app in Angular, we need to test and debug mobile events (such as pinching) that are not triggered from the desktop chrome or Android simulator.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the application on the local network
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng serve &lt;span class="nt"&gt;--host&lt;/span&gt; 0.0.0.0 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Reach app from mobile phone use ip address and port number
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XLCGqIUf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3vrx5jovh1lr4gsf4xu.png" alt="image"&gt;
&lt;/li&gt;
&lt;li&gt;Activate developer options on phone - tap 7 times on &lt;strong&gt;Build Number&lt;/strong&gt; (Settings &amp;gt; About Phone &amp;gt; Build Number)&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;USB Debugging&lt;/strong&gt; (Settings &amp;gt; System &amp;gt; Developer Options &amp;gt; USB debugging)&lt;/li&gt;
&lt;li&gt;Connect phone to computer via usb and &lt;strong&gt;allow usb debugging&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Add to address line &lt;code&gt;chrome://inspect#devices&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Inspect app
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VRXW3JuX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9sp1bow2iwllv5vh7j1m.png" alt="image"&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>angular</category>
      <category>chrome</category>
      <category>android</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Create Linked List with .reduce</title>
      <dc:creator>AlekseiKorolev</dc:creator>
      <pubDate>Tue, 13 Oct 2020 21:39:00 +0000</pubDate>
      <link>https://dev.to/alekseikorolev/create-linked-list-with-reducer-1klh</link>
      <guid>https://dev.to/alekseikorolev/create-linked-list-with-reducer-1klh</guid>
      <description>&lt;p&gt;Easy, readable, and simple way create linked list use built-in function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// Array&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;linkedList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;val&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Can use any type of data&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// Map or Set&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;linkedList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;map&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;val&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Can use &lt;code&gt;.sort&lt;/code&gt; or &lt;code&gt;.reverse()&lt;/code&gt; to change direction and order&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// Object&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;linkedList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort&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;b&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;b&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;val&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>reduce</category>
      <category>linkedlist</category>
    </item>
  </channel>
</rss>
