<?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: K.V.Harish</title>
    <description>The latest articles on DEV Community by K.V.Harish (@kvharish).</description>
    <link>https://dev.to/kvharish</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%2F57540%2F0ee709dc-805d-41c5-a9d5-93ca5755774e.jpeg</url>
      <title>DEV Community: K.V.Harish</title>
      <link>https://dev.to/kvharish</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kvharish"/>
    <language>en</language>
    <item>
      <title>what are the things to consider while building a banking application?</title>
      <dc:creator>K.V.Harish</dc:creator>
      <pubDate>Fri, 04 Sep 2020 06:32:00 +0000</pubDate>
      <link>https://dev.to/kvharish/what-are-the-things-to-consider-while-building-a-banking-application-48kj</link>
      <guid>https://dev.to/kvharish/what-are-the-things-to-consider-while-building-a-banking-application-48kj</guid>
      <description>

</description>
      <category>discuss</category>
      <category>bankingapplication</category>
    </item>
    <item>
      <title>Bored of console.log?</title>
      <dc:creator>K.V.Harish</dc:creator>
      <pubDate>Tue, 23 Jun 2020 11:34:06 +0000</pubDate>
      <link>https://dev.to/kvharish/bored-of-console-log-40do</link>
      <guid>https://dev.to/kvharish/bored-of-console-log-40do</guid>
      <description>&lt;p&gt;A useful and fun thing about console.log is that you can add CSS styles to it. You can do it with the help of %c variable which gets replaced with the respective styles passed in as a parameter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cNTh-ERK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pg12tnhfpce5lii73770.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cNTh-ERK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pg12tnhfpce5lii73770.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can revert the style previously applied using another %c with an empty parameter passed in order.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--viJc5MGW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vzexr7ykrzzd6zp2byrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--viJc5MGW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vzexr7ykrzzd6zp2byrn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can be as creative as you like&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VVUFY44n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h7et18e7pofjo0miqoh9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VVUFY44n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h7et18e7pofjo0miqoh9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also reuse styles using variables&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tuz7kqDK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ghoxc0h2h7b1aco255b8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tuz7kqDK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ghoxc0h2h7b1aco255b8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This feature can really come in handy when you want to differentiate the console logs added at different parts of the code.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>style</category>
      <category>console</category>
      <category>logging</category>
    </item>
    <item>
      <title>Chrome debugger breakpoints not working with create-react-app</title>
      <dc:creator>K.V.Harish</dc:creator>
      <pubDate>Sun, 21 Jun 2020 11:19:51 +0000</pubDate>
      <link>https://dev.to/kvharish/chrome-debugger-breakpoints-not-working-with-create-react-app-39jn</link>
      <guid>https://dev.to/kvharish/chrome-debugger-breakpoints-not-working-with-create-react-app-39jn</guid>
      <description>&lt;p&gt;A few days ago I came across a weird issue with my Chrome debugger when I was working on my ReactJS application created using create-react-app(3.4.1) and I did some logical error so as always I kept a breakpoint at the line of suspicion to check the issue and kept updating the code as the server was running. For some reason, the debugger was not pausing at the breakpoint. I went around searching the internet to find if any other person has faced a similar issue or it was just me.&lt;/p&gt;

&lt;p&gt;I found an open issue in create-react-app with the Chrome debugger breakpoints &lt;a href="https://github.com/facebook/create-react-app/issues/6074"&gt;https://github.com/facebook/create-react-app/issues/6074&lt;/a&gt;. A fix was released but later reverted due to an issue with Webpack.&lt;/p&gt;

&lt;p&gt;One suggested workaround is to add --no-cache in your package.json which worked for me&lt;/p&gt;

&lt;p&gt;From&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;To&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
  "start": "react-scripts start --no-cache",
  "build": "react-scripts build",
  "test": "react-scripts test --no-cache",
  "eject": "react-scripts eject"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If this does not work for you, you can try other suggestions under the issue in the GitHub.&lt;/p&gt;

&lt;p&gt;From the ongoing discussion it seems like we will have to wait for a while for the issue to be fixed.&lt;/p&gt;

</description>
      <category>react</category>
      <category>createreactapp</category>
      <category>chrome</category>
      <category>breakpoints</category>
    </item>
    <item>
      <title>What branching strategy do you use in your company or in your product? What are its pros and cons?</title>
      <dc:creator>K.V.Harish</dc:creator>
      <pubDate>Wed, 30 Oct 2019 15:32:35 +0000</pubDate>
      <link>https://dev.to/kvharish/what-branching-strategy-do-you-use-in-your-company-or-in-your-product-what-are-its-pros-and-cons-1h73</link>
      <guid>https://dev.to/kvharish/what-branching-strategy-do-you-use-in-your-company-or-in-your-product-what-are-its-pros-and-cons-1h73</guid>
      <description>

</description>
      <category>discuss</category>
      <category>git</category>
      <category>branching</category>
      <category>strategy</category>
    </item>
    <item>
      <title>Play videos inline in HTML5 video player on iOS</title>
      <dc:creator>K.V.Harish</dc:creator>
      <pubDate>Tue, 02 Oct 2018 04:23:06 +0000</pubDate>
      <link>https://dev.to/kvharish/play-videos-inline-in-html5-video-player-on-ios-2a18</link>
      <guid>https://dev.to/kvharish/play-videos-inline-in-html5-video-player-on-ios-2a18</guid>
      <description>&lt;p&gt;To give a background. We were using an older version of &lt;a href="https://videojs.com/" rel="noopener noreferrer"&gt;VideoJS&lt;/a&gt; (5.4.4) which does not prevent videos from playing in the native iOS video player like in the below image. So we did not have any control over the playing video.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fcdn.iphonehacks.com%2Fwp-content%2Fuploads%2F2017%2F06%2FiOS-10-vs-iOS-11-Video-player.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fcdn.iphonehacks.com%2Fwp-content%2Fuploads%2F2017%2F06%2FiOS-10-vs-iOS-11-Video-player.jpeg" alt="iOS video player"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image courtesy - &lt;a href="http://www.iphonehacks.com" rel="noopener noreferrer"&gt;http://www.iphonehacks.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With iOS 12 release, our mobile app which was developed in Cordova crashed every time the user exit from fullscreen. &lt;/p&gt;

&lt;p&gt;We analysed the issue and were able to find a solution to force videos to play inline inside the application instead of letting iOS take control over the video.&lt;/p&gt;

&lt;p&gt;Add &lt;em&gt;playsinline&lt;/em&gt; or &lt;em&gt;webkit-playsinline&lt;/em&gt; to your HTML5 video tag. And go to your Cordova config.xml file and add the following preference for iOS platform.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;preference name="AllowInlineMediaPlayback" value="true"/&amp;gt;
~~~~~~~~

Now when we built our application we were successful in preventing the video from playing in native player but we could see the native controls on the video player and on clicking it the user could still switch to iOS native video player. We tried adding all possible css styles suggested on different forums and stackoverflow but those did not help. We finally had to upgrade to latest VideoJS version in which the native controls were hidden. 


Hope this article is helpful.

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

&lt;/div&gt;

</description>
      <category>html</category>
      <category>cordova</category>
      <category>videojs</category>
      <category>javascript</category>
    </item>
    <item>
      <title>JavaScript: Reduce the number of conditional operators used in the expression</title>
      <dc:creator>K.V.Harish</dc:creator>
      <pubDate>Wed, 23 May 2018 16:15:27 +0000</pubDate>
      <link>https://dev.to/kvharish/reduce-the-number-of-conditional-operators-used-in-the-expression-javascript-2h9n</link>
      <guid>https://dev.to/kvharish/reduce-the-number-of-conditional-operators-used-in-the-expression-javascript-2h9n</guid>
      <description>&lt;p&gt;We would have all come across a situation where the number of conditional operators to be used in an expression is more like in the below example.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const firstCondition = true,
      secondCondition = true,
      thirdCondition = true,
      fourthCondition = false,
      fifthCondition = true;

if(firstCondition &amp;amp;&amp;amp; secondCondition &amp;amp;&amp;amp; thirdCondition &amp;amp;&amp;amp; fourthCondition &amp;amp;&amp;amp; fifthCondition) {
    console.log("All the conditions met expectation");  
}
else {
    console.log("All the conditions did not meet expectation");
}

if(firstCondition || secondCondition || thirdCondition || fourthCondition || fifthCondition) {
    console.log("Atleast one of the conditions met expectation");  
}
else {
    console.log("None of the conditions met the expectation");
}

//Output:
//All the conditions did not meet the expectation
//At least one of the conditions met expectation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Code quality tools like ESLint, SonarQube, etc will actually suggest us to optimize this code to have fewer conditional operators. So how do we do that? &lt;/p&gt;

&lt;p&gt;There are many ways to solve this. I am going to give a simpler way (Updated). If you have an easier or better solution please feel free to leave it in the comment section.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const firstCondition = true,
      secondCondition = true,
      thirdCondition = true,
      fourthCondition = false,
      fifthCondition = true;

const conditionsToCheck = [firstCondition, secondCondition, thirdCondition, fourthCondition, fifthCondition]

if(conditionsToCheck.every(condition =&amp;gt; condition)) {
    console.log("All the conditions met expectation");
}
else {
    console.log("All the conditions did not meet expectation");
}

if(conditionsToCheck.some(condition =&amp;gt; condition)) {
    console.log("Atleast one of the conditions met expectation");
}
else {
    console.log("None of the conditions met the expectation");
}

//Output:
//All the conditions did not meet the expectation
//At least one of the conditions met expectation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We can also mix in conditions like below and it would work without any problem.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const conditionsToCheck = [firstCondition, secondCondition || sixthCondition, thirdCondition, fourthCondition, fifthCondition &amp;amp;&amp;amp; seventhCondition];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Unless you are supporting IE8 and below you should fine using Array some and every methods.&lt;/p&gt;

&lt;p&gt;I hope this article is helpful.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>codequality</category>
      <category>conditionaloperators</category>
    </item>
  </channel>
</rss>
