<?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: Pradnyanand Milind Pohare</title>
    <description>The latest articles on DEV Community by Pradnyanand Milind Pohare (@paddy57).</description>
    <link>https://dev.to/paddy57</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%2F342836%2F3c029a7c-21f0-4dce-ab02-e6b8f1b7417e.png</url>
      <title>DEV Community: Pradnyanand Milind Pohare</title>
      <link>https://dev.to/paddy57</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paddy57"/>
    <language>en</language>
    <item>
      <title>The Unseen Conductor: Orchestrating App Notifications with EventBus</title>
      <dc:creator>Pradnyanand Milind Pohare</dc:creator>
      <pubDate>Sat, 20 Sep 2025 18:50:04 +0000</pubDate>
      <link>https://dev.to/paddy57/the-unseen-conductor-orchestrating-app-notifications-with-eventbus-3nca</link>
      <guid>https://dev.to/paddy57/the-unseen-conductor-orchestrating-app-notifications-with-eventbus-3nca</guid>
      <description>&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%2Fg4ui1kavje3e13mv2480.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%2Fg4ui1kavje3e13mv2480.png" alt="Image" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and The Problem.
&lt;/h2&gt;

&lt;p&gt;At my current company, we have a wholesale app designed for tier-2 or tier-3 city Kirana (grocery) stores to purchase goods at wholesale prices. Because this is a B2B integration, there are a lot of offer popups, nudges, notifications, and feedback popups each time a user opens the app. That’s a poor user experience: bombarding the user with multiple things on app startup is not ideal, and doing so all at once is particularly jarring.&lt;/p&gt;

&lt;p&gt;To illustrate, imagine you’re using a food-delivery app that needs to show several messages: first asking for location permission, then introducing new features, then asking for a rating—all shown at once. That would be annoying.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is EventBus ?
&lt;/h2&gt;

&lt;p&gt;That is where EventBus comes into the picture. EventBus helps widgets that are not directly related or screens that aren’t dependents of each other communicate with one another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A user completes an action on Screen A (e.g., saving a profile update), and Screen B (e.g., a settings screen) needs to be refreshed or updated to reflect this change. Instead of passing callbacks or using shared ChangeNotifiers that can become unwieldy, Screen A can fire an event, and Screen B can listen for it.  &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%2F9rsy2flxnawvote8zerq.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%2F9rsy2flxnawvote8zerq.png" alt="Image" width="800" height="882"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How EventBus was useful for us ?
&lt;/h2&gt;

&lt;p&gt;Because there were multiple popups that were compiled and shown to the user at the same time, using EventBus allowed us to display them in a sequencing order. An additional enhancement was that once a popup is shown, we check whether the next popup in the sequence is available. This prevents the user from waiting for data to fetch for the next popup and allows it to show immediately when ready.&lt;/p&gt;

&lt;p&gt;This is like having a smart assistant that presents a series of popup messages on your phone, one after another, in a specific order, waiting for you to close each one before showing the next.&lt;/p&gt;

&lt;p&gt;Think of it like a queue at a restaurant where the waiter brings dishes in a specific order. The system has a list of all the popups it wants to show (A, B, C, D), but it’s smart enough to check if each popup is relevant right now. For example, if you’ve already granted location permission, it won’t show that popup again. It only shows popups that make sense for your current situation. When you close one popup, it automatically shows the next one in line, creating a smooth, organised experience instead of bombarding you with multiple popups at once.&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%2Fl6scxsppub3jpyob2h28.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%2Fl6scxsppub3jpyob2h28.png" alt="Image" width="800" height="711"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I have added a demo implementation of EventBus in this &lt;a href="https://github.com/paddy57/event_bus_demo" rel="noopener noreferrer"&gt;Github repo&lt;/a&gt; do check that out. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Different use cases that I can think off
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Changing App Theme&lt;/li&gt;
&lt;li&gt;Scrolling/Refreshing list to top when user clicks on bottom navigation tab bar (WhatsApp, Instagram, many of such social medial app have this functionality)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Limitations of using EventBus
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Debugging Complexity&lt;/strong&gt; - Events can be fired from anywhere and received by multiple listeners anywhere else in the application. This "publish-subscribe" model can make it challenging to trace the exact path an event takes from its origin to all its destinations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Global State Issues&lt;/strong&gt; - Because any component can subscribe to any event, it's easy for a component to react to an event it wasn't designed to handle, leading to unexpected behaviour. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to use EventBus ?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You have truly global, infrequent, and lightweight notifications that affect multiple&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When an event can affect a varying number of components, and the publisher doesn't need to manage the list of subscribers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In larger applications, different modules or features might need to communicate without having direct dependencies on each other.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Alternative to EventBus
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Direct Method Calls / Function Callbacks&lt;/strong&gt; - calling component directly invokes a method or passes a callback function to the component it needs to interact with.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;State Management&lt;/strong&gt; -  Provider, BLoC/Cubit etc&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Navigation and Route Arguments&lt;/strong&gt; -  When navigating between screens, you can pass data directly as arguments to the new route.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Bottom line:&lt;/strong&gt; Your app shouldn’t rely solely on EventBus. Use a combination of the alternatives above as appropriate.&lt;/p&gt;

&lt;h2&gt;
  
  
  About Me
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://pradnyanandpohare.in" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pradnyanand.substack.com" rel="noopener noreferrer"&gt;NewsLetter - Something To Read&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>flutter</category>
      <category>frontend</category>
      <category>dart</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Why app gets slow in Debug mode, React Native</title>
      <dc:creator>Pradnyanand Milind Pohare</dc:creator>
      <pubDate>Sun, 30 May 2021 15:08:53 +0000</pubDate>
      <link>https://dev.to/paddy57/why-app-gets-slow-in-debug-mode-react-native-191d</link>
      <guid>https://dev.to/paddy57/why-app-gets-slow-in-debug-mode-react-native-191d</guid>
      <description>&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%2F1ifmd1hq1whhi7izgjrx.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%2F1ifmd1hq1whhi7izgjrx.png" alt="Image" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was in my interview phase, In one my interview the interviewer asked me "Why our app gets slow in debug mode ?". I didn't have any answer to  that question then. So I said "To be honest I don't know, I have gone through this situation but I never explore the reason behind it"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Always explore the why part behind each basic things while learning.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So after the interview I started to search on google the reason behind it.  And this is what I have came to know.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;When we use Debug JS Mode while developing React Native app, App gets very slow, JS Frame rate gets dropped.&lt;/p&gt;

&lt;p&gt;Each button click and transition takes almost a couple of seconds and sometimes even more. With all this, debugging application feels like working windows vista.&lt;/p&gt;

&lt;h1&gt;
  
  
  What happens when We turn on Debug Mode
&lt;/h1&gt;

&lt;p&gt;When we switch on Debug mode then instead of running JavaScript code in your Phone or Simulator  it runs in chrome or debugger your are using on your computer.  And that's why the interaction with app gets slow. &lt;/p&gt;

&lt;p&gt;For example you click on a button then that event gets register in app  then it gets send to the debugger or chrome. So this process makes the app slow. &lt;/p&gt;

&lt;p&gt;When you use Hermes in a production build, the bytecode is compiled in advance and can be executed quickly. &lt;/p&gt;

&lt;p&gt;Reference from A &lt;a href="https://github.com/facebook/hermes/issues/48#issuecomment-513340897" rel="noopener noreferrer"&gt;thread&lt;/a&gt; -- &lt;em&gt;When you use Hermes locally with Metro, Hermes is running in a lazy compilation mode. This is faster than compiling all the bytecode every time you reload from Metro, but slower than a production build. So slowness in dev mode does not necessarily means slowness in release mode. If Metro were able to compile bytecode one module at a time and deliver it incrementally to the device, this would probably help.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What can we do to fix this ?
&lt;/h1&gt;

&lt;p&gt;From above section we came to know that If we switch on the debug mode the app tend to run slow. But there can be some extra factor which can make the app very slow in debug mode. So for that we can try following solutions&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove excess amount of  console logs&lt;/li&gt;
&lt;li&gt;Check the time clocks on your phone and your computer. They should match or you can keep the phone's clock to a few seconds ahead of the computer.&lt;/li&gt;
&lt;li&gt;Instead of chrome debugger use &lt;a href="https://github.com/jhen0409/react-native-debugger" rel="noopener noreferrer"&gt;React Native Debugger.&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Deactivate the "Slow animation" option in the debug menu.&lt;/li&gt;
&lt;li&gt;Always try to resolve warnings if there are any.&lt;/li&gt;
&lt;li&gt;Try solutions from this &lt;a href="https://github.com/facebook/hermes/issues/48#issuecomment-513900202" rel="noopener noreferrer"&gt;issue&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even after trying above solution if your app is running slow then you should check another app in debug mode if that one is working fine then in your first application there can be problem in code , maybe re-rendering of components happening.&lt;/p&gt;

&lt;p&gt;I hope this blog help anyone out there.&lt;/p&gt;

&lt;p&gt;If you want to read more Do visit &lt;a href="https://www.pradnyanandpohare.in" rel="noopener noreferrer"&gt;my website and  &lt;strong&gt;Don't forget to subscribe to blog you will get update whenever I upload a new one. Cheers&lt;/strong&gt;&lt;/a&gt;. Cheers.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>debugging</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Problem With My Website</title>
      <dc:creator>Pradnyanand Milind Pohare</dc:creator>
      <pubDate>Sat, 29 May 2021 19:01:35 +0000</pubDate>
      <link>https://dev.to/paddy57/the-problem-with-my-website-6nd</link>
      <guid>https://dev.to/paddy57/the-problem-with-my-website-6nd</guid>
      <description>&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%2Ffbgd65wtwhrm82vt5cbn.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%2Ffbgd65wtwhrm82vt5cbn.png" alt="Image" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So in 2018, I was working on this project where I needed to integrate Paytm’s payment gateway to an app. I never used Paytm's gateway before in any of my applications. So I was researching on it a lot. After one day of research I started to work on it. In half day the integration was done, but there was an issue. &lt;/p&gt;

&lt;p&gt;The payment was only working via paytm's wallet and not by any debit or credit card. Me and my colleague &lt;a href="https://www.linkedin.com/in/adityarshinde/" rel="noopener noreferrer"&gt;Aditya&lt;/a&gt; worked on it for another half day, but we did not find any solution for that. So finally we tweeted Paytm on this issue and started to wait for the response.&lt;/p&gt;

&lt;p&gt;On the weekend me and my friend went outside for the dinner and I was trying to pay the bill by Paytm wallet but the transaction was not happening. Then a message came from the Paytm that &lt;strong&gt;&lt;em&gt;I have to first complete Paytm KYC.&lt;/em&gt;&lt;/strong&gt; And then I thought may be this the issue with my application. &lt;/p&gt;

&lt;p&gt;So on next day me and Aditya completed our KYC. Came back to office and tried to do any random transaction on my app but still it was not showing any card option to do payments. I was very frustrated with that, we went outside where temperature was like killing our body and till my payment was not happening. We gave a break and waited for the Paytm official to contact us. &lt;/p&gt;

&lt;p&gt;After two days Paytm’s response came and what the solution was very easy and laughable. They told that the integration you are trying is in &lt;strong&gt;“Test"&lt;/strong&gt; mode, to do transaction with your debit card  you have to change your paytm mode to &lt;strong&gt;“Transaction”&lt;/strong&gt; mode. &lt;/p&gt;

&lt;p&gt;I was laughing like anything because in other payment gateway like in &lt;strong&gt;“Instamojo”&lt;/strong&gt; or &lt;strong&gt;“PayUMoney”&lt;/strong&gt; you can use dummy debit card details to do payment and I thought it will be same with paytm too. I was wrong. HAHAHA   &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Always read the documentation carefully.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While writing down this blog also I was smiling becuase it was very silly mistake on my side. Well that's how you develope a mobile application I guess, by try and error. Cheers.&lt;/p&gt;

&lt;p&gt;If you want to read more Do visit &lt;a href="https://www.pradnyanandpohare.in" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Cheers.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>androidappdevelopement</category>
      <category>paytm</category>
    </item>
    <item>
      <title>The Problem With My Website</title>
      <dc:creator>Pradnyanand Milind Pohare</dc:creator>
      <pubDate>Fri, 14 May 2021 15:12:22 +0000</pubDate>
      <link>https://dev.to/paddy57/the-problem-with-my-website-4j5e</link>
      <guid>https://dev.to/paddy57/the-problem-with-my-website-4j5e</guid>
      <description>&lt;p&gt;Here I'm talking about &lt;a href="https://www.pradnyanandpohare.in" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. It's my portfolio website and one thing I was sure that I needed one. I have this one from past two years and time to time I'm trying to improve it.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;We need to improve or fix something when there is a problem. And the problem with my website was &lt;strong&gt;&lt;em&gt;each time I used to switch to new route my component used to mount again and api call used to fire to fetch data.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Issues with this &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User have to wait until component render data&lt;/li&gt;
&lt;li&gt;API used to fire again an again to get data&lt;/li&gt;
&lt;li&gt;Website used feel slow &lt;/li&gt;
&lt;li&gt;All the state data used to reset &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Findings
&lt;/h1&gt;

&lt;p&gt;When I look online it says whenever we change path, in react it mount that component again. But  I was thinking why the online website does not behave like mine one does. &lt;br&gt;
I asked my friend &lt;strong&gt;Mohit&lt;/strong&gt; and &lt;strong&gt;Anurag&lt;/strong&gt; as both were working with React JS from couple of years. &lt;/p&gt;

&lt;p&gt;The conclusion of the discussion was to use &lt;strong&gt;redux&lt;/strong&gt; and have a state to check whether user visited that page or not  and according to that in ComponentDidMount trigger animation or fetch API . &lt;/p&gt;

&lt;h1&gt;
  
  
  Implementation
&lt;/h1&gt;

&lt;p&gt;After adding redux and all other checks in ComponentDidMount , the redux state used to reset whenever I used to change my route. I thought my be its because I'm using class component but its should not matter whether its class or functional because store should not reset because of it. &lt;/p&gt;

&lt;p&gt;So I went to basic, I looked online How one navigate to another page. Thats where I found my mistake.I was using Anchor Element to navigate to another page where everyone was using one of the following method &lt;/p&gt;

&lt;h2&gt;
  
  
  1.Link
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/path&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;btn btn-primary&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Navigate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2.Redirect (From react-router)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Redirect&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/myComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3.Using history prop
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I ended up using history prop to navigate between my pages. So the combination of redux state check and navigating using history prop I'm able solve my problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things Improved
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No multiple calls to API for data&lt;/li&gt;
&lt;li&gt;User does not have to wait &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Maybe I'm right maybe I'm wrong but for now It's how I resolved it. Do let me know guys if you hsave any other solution by commenting below. &lt;/p&gt;

&lt;p&gt;If you want to read more Do visit &lt;a href="https://www.pradnyanandpohare.in" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Cheers.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>portfolio</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Right Decision</title>
      <dc:creator>Pradnyanand Milind Pohare</dc:creator>
      <pubDate>Sat, 14 Mar 2020 15:07:13 +0000</pubDate>
      <link>https://dev.to/paddy57/going-with-the-flow-5a6j</link>
      <guid>https://dev.to/paddy57/going-with-the-flow-5a6j</guid>
      <description>&lt;p&gt;It was the last week of August, I was At T.I.M.E Institute preparing for CAT 2018. It was the main reason for me to come to Pune. One day I was going through my Internshala Profile and I started to apply for internship. Arcanheim Softworks was one of the companies I applied to, and even got a call from them the very next day. I remember vividly, I was in my bed, watching Casey Neistat's videos on Youtube when I saw my mail notification from Internshala, I have an interview next day in the afternoon at Arcahnheim Softworks. Literally a lot of thoughts were going through my mind. What should I do?, Should I go for the interview or not?, what If I got selected?. Surely I would have to quit TIME, that too after paying the entire, Non-refundable fees. I still remember, I switched off my laptop and took a nap(Its something I do when I find myself in a position like this :p). The next morning I woke up and thought to myself why not just go for the interview?, It will be a good experience. I put on my formals and went for the Interview, thanks to Ola’s share cab, it took me two hours to reach just nine km, I thought I’m screwed.&lt;/p&gt;

&lt;p&gt;I was in the Building but Couldn’t find the office. The HR who contacted me for the interview, her number was also out of reach, so I went on google, got the C.E.O’s number and asked for the direction and came on the third floor of RK1 building in Rasta Peth, Pune. I was outside of the office, Obviously a little nervous knocked on the door and Aastha (HR) opened the door and asked me to sit on the sofa. I was wearing formals, which I don’t like to wear, I was without a belt and the shirt which was white at some point of time, which was now pale yellow. They called me inside, I went directly to The Interview room, sat on the chair and waited for the interviewer to come. Till then I took out my phone, launched my Tree Identifier application, and took a photo of the plant which was behind me. It had a complicated name. Sumeet and Aditya were the two guys who took my Interview. They started with the question “What Type of application I have made so far?“, and personally I liked the starting question. Because in most of the interviews The Interviewer starts with a question like "Tell me about yourself?".&lt;/p&gt;

&lt;p&gt;I’m not against the question, but I prefer the person interviewing me to have more interest in my work more than me as a person, especially at the start of an interview. I might be wrong, I might be right. It's my personal opinion. Then my interview went ahead, I showed them all my IOS applications and talked about my Interest. I was aware that its a gaming company and was wondering what project would I be working on as an intern. I was happy to know that I will be working in the Android Development area. In between questions they both were looking in screen and I was looking outside, checking out what other people are working on and whether they were wearing formals in office, HAHAHA I was more curious about that. My Interview got over, they asked me “Do you have any questions?” and my question was “Do you have any dress code to follow in office”. The answer was “NO”, And we all smiled on that.&lt;br&gt;
My interview was over, I took the lift, went down, booked a cab, Again the Ola share cab, and while listening to some old Hindi songs, I was thinking about how the interview went. I was hoping to get this internship so that I will start working rather than going to a coaching class.&lt;/p&gt;

&lt;p&gt;I never thought of doing an internship after college, but I was more curious to start work. They sent me a mail and it was about result of the interview which would be out tomorrow. Guess what next day I got a call from Mayuraj(C.E.O), and he told me that I’m selected as an Android Developer. I still remember he asked me on phone “Are you happy?” and I was like “Hell Yeah, I’m Happy”. The First Week Of September I joined the company and as I expected, On the very first day I was working on my first project in Android. This was my interview experience, which I wanted to share with you all, to give you all a message that anything is possible in life, Life is full of surprises. This was my chance to do what I wanted to do from my college time and I took it. I left the coaching and started going to work each day and I'm very thankful for my parents for that because they always trusts my decision.&lt;/p&gt;

&lt;p&gt;If you guys have any questions, you can ask me in the comment section or on my Linkedin. Doing what you love will make life better and work will not feel like work.&lt;/p&gt;

&lt;p&gt;If you want to read more Do visit &lt;a href="https://www.pradnyanandpohare.in" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Cheers.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>android</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>How to cache videos in a react-native project using Android's ExoPlayer cache</title>
      <dc:creator>Pradnyanand Milind Pohare</dc:creator>
      <pubDate>Thu, 27 Feb 2020 18:25:51 +0000</pubDate>
      <link>https://dev.to/paddy57/how-to-cache-videos-in-a-react-native-project-using-android-s-exoplayer-cache-35j2</link>
      <guid>https://dev.to/paddy57/how-to-cache-videos-in-a-react-native-project-using-android-s-exoplayer-cache-35j2</guid>
      <description>&lt;h2&gt;
  
  
  Why we cache data?
&lt;/h2&gt;

&lt;p&gt;Cache means storing data inside the memory. We access data from a server by making network calls. If we trying to access the same data again and again then making a network call each time does not make any scene. That is where cache comes to help. We store data inside memory,  access them from memory, which saves the user's internet data. &lt;/p&gt;

&lt;p&gt;Coming back to the topic of this blog, If we want to play videos inside a react-native project there is an amazing library called &lt;a href="https://github.com/react-native-community/react-native-video" rel="noopener noreferrer"&gt;react-native-video&lt;/a&gt;. This library can be used to play videos inside Android and IOS. But there is a catch, react-native-video provides caching for IOS only, not for Android. So how can we cache videos using react-native-video inside Android? &lt;/p&gt;

&lt;h2&gt;
  
  
  There are two ways you can cache videos
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;a href="https://github.com/zhigang1992/react-native-video-cache" rel="noopener noreferrer"&gt;react-native-video-cache&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Basically react-native-video-cache creates a local proxy server to play videos using the AndroidVideoCache library and when it completes caching its serves videos through cache directory. Which is perfect, that is what we want but when I test it on BrowserStack, Videos was not playing, I was getting 502 error. Which is weird because videos were playing into an actual android device. May be browser stack does not allow us to create a local proxy server. I’m not sure if anyone has any idea please comment down below.&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%2Fi%2Fiflhpv9mal7pnjhso508.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%2Fi%2Fiflhpv9mal7pnjhso508.png" alt="Alt Text" width="342" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;a href="https://github.com/itinance/react-native-fs" rel="noopener noreferrer"&gt;react-native-fs&lt;/a&gt; and &lt;a href="https://github.com/wkh237/react-native-fetch-blob" rel="noopener noreferrer"&gt;react-native-fetch-blob&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Both libraries use file systems to download and store data. But consider this case, You have multiple videos in a list to play but we have to wait until they get download, which is frustrating also not correct to make a user wait. It's not caching while we stream them. &lt;/p&gt;

&lt;h4&gt;
  
  
  So How can we cache videos while streaming?
&lt;/h4&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://github.com/paddy57/react-native-video-android-cache" rel="noopener noreferrer"&gt;react-native-video-android-cache&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The library react-native-video provides us, two players to use Android’s default player and Android ExpoPlayer. ExoPlayer does support caching videos, So why not I make the change inside ExoPlayer which react-native-video uses.&lt;/p&gt;

&lt;p&gt;So I looked on google for caching inside ExoPlayer and found the solution on &lt;a href="https://stackoverflow.com/questions/28700391/using-cache-in-exoplayer#" rel="noopener noreferrer"&gt;StackOverflow&lt;/a&gt;. So I forked react-native-video library, created a custom class that uses CacheDataSource from ExoPlayer to cache videos. Also, I had to make a change inside ReactExoplayerView class from react-native-video, where instead of returning default mediaDataSourceFactory I had to return custom class which we have created.&lt;/p&gt;

&lt;p&gt;I have named the forked library as &lt;a href="https://github.com/paddy57/react-native-video-android-cache" rel="noopener noreferrer"&gt;react-native-video-android-cache&lt;/a&gt;, You can use this library to cache your videos using react-native-video in Android. You can provide maximum cache size and maximum file size. &lt;/p&gt;

&lt;p&gt;Step 1 - &lt;br&gt;
npm install --save git+&lt;a href="https://git@github.com/paddy57/react-native-video-android-cache.git" rel="noopener noreferrer"&gt;https://git@github.com/paddy57/react-native-video-android-cache.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step2&lt;/p&gt;

&lt;p&gt;You may need to link react-native-video to your project. Follow this link (&lt;a href="https://github.com/react-native-community/react-native-video#android-installation" rel="noopener noreferrer"&gt;https://github.com/react-native-community/react-native-video#android-installation&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;That's it. Just observe app cache size increasing while you stream videos. I hope this library will be useful to you. &lt;/p&gt;

&lt;p&gt;If you want to read more Do visit &lt;a href="https://www.pradnyanandpohare.in" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Cheers.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>android</category>
      <category>opensource</category>
      <category>npm</category>
    </item>
    <item>
      <title>How to fork GitHub repository and use as npm dependency inside a react-native project</title>
      <dc:creator>Pradnyanand Milind Pohare</dc:creator>
      <pubDate>Thu, 27 Feb 2020 16:06:09 +0000</pubDate>
      <link>https://dev.to/paddy57/how-to-fork-github-repository-and-use-as-npm-dependency-inside-a-react-native-project-2j21</link>
      <guid>https://dev.to/paddy57/how-to-fork-github-repository-and-use-as-npm-dependency-inside-a-react-native-project-2j21</guid>
      <description>&lt;p&gt;Forking is the one thing I have never used in git. Yesterday I came to know how can we use it. &lt;/p&gt;

&lt;p&gt;Why we use a fork?&lt;/p&gt;

&lt;p&gt;Open source is a great thing, someone writes a library, so that others can use it, others can add up to it. Let's assume you are using an open-source library in your project, the library has everything you need except that the one thing you need for your project. That's where forking comes to help. Basically forking means you are creating a copy of the open-source library, making appropriate changes, committing back or submitting a pull request to the author of the open-source library.&lt;/p&gt;

&lt;p&gt;How to fork an open-source library&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click on the Fork button on the right top corner of open-source GitHub repository &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then clone the forked library inside your local directory &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git clone "forked lib URL"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make appropriate changes to the library and commit it &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git add .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git commit -m “commit message”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git push origin master&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now all the changes you want to make in the open-source library are there, the only thing remaining is to use this forked library as a dependency in your react native project.&lt;/p&gt;

&lt;p&gt;How to use GitHub repository as an npm dependency in a react-native?&lt;/p&gt;

&lt;p&gt;We make changes in open source libraries because we want the library to behave different for our project. Now consider a scenario &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You went to node_modules/open_source_library&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You made the changes &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are done here but in the future, there will be a case where we need to delete node_modules in order to resolve Android Studio’s linking with react-native libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now you will run npm install in order to install the open-source library. All your changes now has override by the original library. This means you need to make those changes again.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s why we fork the library and make changes so that we can use it as an npm dependency. Only question here is "How can we so that?”&lt;/p&gt;

&lt;p&gt;It's very simple, You just need to run following command.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You should be in your project directory&lt;/li&gt;
&lt;li&gt;npm install --save git+&lt;a href="https://git@your" rel="noopener noreferrer"&gt;https://git@your&lt;/a&gt; fork repository URL without https://.git&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You will notice that inside package.json in the dependency section, Instead of the open-source library version you will see your fork library.&lt;/p&gt;

&lt;p&gt;That’s it. I hope this blog will help you in any way possible. &lt;/p&gt;

&lt;p&gt;If you want to read more Do visit &lt;a href="https://www.pradnyanandpohare.in" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Cheers.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>github</category>
      <category>npm</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
