<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Srikanth Bandaru on Medium]]></title>
        <description><![CDATA[Stories by Srikanth Bandaru on Medium]]></description>
        <link>https://medium.com/@srikanthbandaru?source=rss-116fd975711f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9d04DUdNIpUH-J_csU5ZyA.jpeg</url>
            <title>Stories by Srikanth Bandaru on Medium</title>
            <link>https://medium.com/@srikanthbandaru?source=rss-116fd975711f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 09:40:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srikanthbandaru/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I built the portfolio section of https://bsrikanth.com]]></title>
            <link>https://medium.com/@srikanthbandaru/how-i-built-the-portfolio-section-of-https-bsrikanth-com-20035d61f0aa?source=rss-116fd975711f------2</link>
            <guid isPermaLink="false">https://medium.com/p/20035d61f0aa</guid>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Srikanth Bandaru]]></dc:creator>
            <pubDate>Mon, 21 Jan 2019 00:38:44 GMT</pubDate>
            <atom:updated>2019-01-21T00:38:44.752Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ofxEgos8e4RhLj83" /><figcaption>Photo by <a href="https://unsplash.com/@laurenmancke?utm_source=medium&amp;utm_medium=referral">Lauren Mancke</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I am very happy, especially in this section. The portfolio list is not hardcoded. How lame would that be?😊 A GraphQL query fetches all my repositories information from my GitHub and will pass it down to my Portfolio.js component as props.</p><p>Now, in GitHub, I can pin the repositories to my profile that I am very proud of. It would be awesome if I can show my pinned repositories at the beginning of my portfolio list too. So, I wrote a logic that sorts my portfolio projects bringing my pinned projects to the beginning of the list.</p><p>We need one more piece of data before we can start rendering my portfolios on to the dom. The <strong>filter options</strong>. These are… nope, not hardcoded. These are dynamic too. I wrote a logic that fetches all the labels in every repository I have and then sorts them by their occurrence of frequency. In other words, the more frequent I use a technology, the more likely it is going to end up at the beginning of my filter options. I am also limiting the number of dynamic filter options to only 3. With two hardcoded options ‘ALL’ &amp; ‘OTHER’ where one displays all my GitHub repositories without any filters and the ‘OTHER’ filter displays repositories which have less frequent labels.</p><p>Finally, I am looping my portfolio projects array and rendering each item with my PortfolioCard.js template. On click on any Portfolio Card, that particular repository’s README.md contents will be fetched with again a GRAPHQL query and displayed in a slider that users can close by clicking the X icon on the top right corner or can just hit the ESC key on their keyboards.</p><p>The syntax highlighting in the Project Content page is powered by PrismJS. I am also using shuffleJS to achieve the cool animation effects while shuffling.</p><p>Last but not least, the <strong>view more</strong> button. I don’t want to render all my portfolio items at a time. That will clutter the page. So, I am displaying only 3 items at a time on medium and small devices and 6 items on large devices. If the user wishes to view more, they can click on the View More button to render 3 more items on a single click. It has a nice counter for convenience too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSVMJWeuSkAaIs1bnGC4gg.jpeg" /><figcaption>At the time of this writing, here is how my Portfolio section looks</figcaption></figure><p>Hope you have enjoyed this article.</p><p>Please let me know if you have any questions in the comments below.</p><p>Peace!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20035d61f0aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Explained: The Event Loop]]></title>
            <link>https://medium.com/@srikanthbandaru/javascript-explained-the-event-loop-e6ba4dce1a06?source=rss-116fd975711f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6ba4dce1a06</guid>
            <category><![CDATA[call-stack]]></category>
            <category><![CDATA[event-loop]]></category>
            <category><![CDATA[callback]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Srikanth Bandaru]]></dc:creator>
            <pubDate>Sun, 20 Jan 2019 01:49:30 GMT</pubDate>
            <atom:updated>2019-01-20T01:50:40.310Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EEw0zaDFB9VpkaIP" /><figcaption>Photo by <a href="https://unsplash.com/@tine999?utm_source=medium&amp;utm_medium=referral">Tine Ivanič</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><em>To make complete sense of this article, please make sure to get yourselves familiarized about </em><em>call stack and </em><em>execution context: </em><a href="https://medium.com/@srikanthbandaru/javascript-what-is-execution-context-call-stack-9e28e15f07ad"><em>https://medium.com/@srikanthbandaru/javascript-what-is-execution-context-call-stack-9e28e15f07ad</em></a></p><blockquote>JavaScript is a single-threaded, non-blocking, asynchronous, concurrent language.</blockquote><p>Now, how can a language be both single-threaded but asynchronous at the same time? The answer is because of the <strong>Event Loop </strong>and the associated <strong>Event Queue.</strong></p><p>Let’s suppose the Javascript engine is running some function foo(), and in the meantime, a user clicks on a button on the webpage. A KeyPress event would be fired and since Javascript engine is busy executing foo(), this new click event would be queued in the Event Queue (also called the callback Queue).</p><p>Let’s look at the below code to understand it well.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d68dc631b13873f5d6d31b97cb12a892/href">https://medium.com/media/d68dc631b13873f5d6d31b97cb12a892/href</a></iframe><p>If you haven’t figured it out already, the output of the above code in most machines with a fast network is,</p><pre>// Hello!<br>// 3<br>// 1<br>// 2</pre><h3>Under the hood</h3><p>First, console.log(“Hello!”); is executed and as a result, Hello! is logged on to the console. Now, it looks atfetch. But, fetch is a Web-API method and JavaScript itself doesn’t know what to do with it. So, it hands it off to the Web API’s. The same goes for the setTimeout. So, it is also handed off the Web API’s for execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*temZb7rZqkf-NdcXQBbOhg.jpeg" /></figure><p>Now, after completing execution of the web API&#39;s, fetch() and setTimeout() are sent to the callback queue.</p><p>If the call stack is empty, the <strong>Event Loop</strong> checks for the next message in the queue and sends it to the call stack.</p><blockquote>Basic job of the <strong>Event Loop</strong> is to look both at the call stack and the task queue, pushing the first thing on the queue to the stack when it sees stack as empty.</blockquote><p>That’s it! That is what basically event loop does.</p><p>Peace!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6ba4dce1a06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript: What is Execution Context & Call Stack]]></title>
            <link>https://medium.com/@srikanthbandaru/javascript-what-is-execution-context-call-stack-9e28e15f07ad?source=rss-116fd975711f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e28e15f07ad</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[call-stack]]></category>
            <category><![CDATA[execution-context]]></category>
            <category><![CDATA[execution-stack]]></category>
            <dc:creator><![CDATA[Srikanth Bandaru]]></dc:creator>
            <pubDate>Sat, 19 Jan 2019 16:40:36 GMT</pubDate>
            <atom:updated>2019-01-19T17:33:43.510Z</atom:updated>
            <content:encoded><![CDATA[<h3>JavaScript Explained: What is Execution Context &amp; Call Stack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BnKNflOWLGRL1xid" /><figcaption>Photo by <a href="https://unsplash.com/@clemhlrdt?utm_source=medium&amp;utm_medium=referral">Clément H</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Understanding the fundamentals of a programming language gives us a broader perception and it is what separates a junior developer from a senior developer.</p><h3><strong>Execution Context</strong></h3><p>The <em>execution context</em> is a context created when a function is executed. It is composed of the activation object (the function’s parameters and local variables), a reference to the outer environment also called the scope chain, and the value of this. Under the hood of the JavaScript engine, every call to an execution context has two phases.</p><h4>Phase #1: Creation phase</h4><p>It is this short but very important period of time when the function is called but before it executes any code inside.</p><p>During this phase, the JavaScript engine creates variables and sets up memory space for variables and functions. It doesn’t know what the value of the variable will be until it actually executes the function. So it puts a placeholder called undefined. This is called hoisting. It’s the reason why you can call functions in the JS even before you declared them.</p><p>It also creates the scope chainand determines the value of this.</p><h4>Phase #2: Execution phase</h4><p>In this phase, the code execution takes place. The JS engine assigns values to variables in the memory and starts executing the code.</p><h3><strong>Call Stack</strong></h3><p>The JavaScript engine in the browser is implemented as single threaded. This means that only one thing can happen at a time and other actions or events will be queued.</p><p>The <em>call stack(or the execution context stack)</em> can be thought of as an array of execution contexts with the bottom of the stack being global execution context.</p><p>If we call a function to execute, we push its execution context on to the stack, and when we return from a function, we pop off the top of the stack. This is why a <strong>Stack Trace</strong>is basically the state of the c<em>all stack</em> when the exception happened.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e28e15f07ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>