<?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[Seriea Pub - Medium]]></title>
        <description><![CDATA[Series A focuses on specialized solutions for different startups and Series A funded organizations. - Medium]]></description>
        <link>https://medium.com/seriea-pub?source=rss----d16af88cf8df---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Seriea Pub - Medium</title>
            <link>https://medium.com/seriea-pub?source=rss----d16af88cf8df---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:07:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/seriea-pub" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why do conditionals matter in ReactJs == vs ===?]]></title>
            <link>https://medium.com/seriea-pub/why-do-conditionals-matter-in-reactjs-vs-e92525410e0f?source=rss----d16af88cf8df---4</link>
            <guid isPermaLink="false">https://medium.com/p/e92525410e0f</guid>
            <category><![CDATA[react-core-concept]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[conditional-statements]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Dibesh Raj Subedi]]></dc:creator>
            <pubDate>Fri, 26 Aug 2022 08:17:39 GMT</pubDate>
            <atom:updated>2022-08-26T08:17:39.297Z</atom:updated>
            <content:encoded><![CDATA[<p>At core of <strong>ReactJs </strong>conditionals play a significant role in determining the whole application&#39;s behaviour. But first, let&#39;s understand what conditional statements are. A conditional statement generally refers to a logic that helps determine whether a presented context is truthy or falsy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k_gSiXJRsFUvLGY-wF9LEQ.png" /></figure><p>Let’s take an example, where we have to check if the value stored in a variable is truthy or falsy.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d8ac32164ab021f24a1fec80f9c52405/href">https://medium.com/media/d8ac32164ab021f24a1fec80f9c52405/href</a></iframe><p>As we can observe the comparative result of 18 and userAge is true. This is because userAge stores a number and 18 is a number and they both are equal. There are several conditionals in core <em>JavaScript</em> so let&#39;s observe the behaviour of some of them.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/953d29a44dd8a36888bc428445053d19/href">https://medium.com/media/953d29a44dd8a36888bc428445053d19/href</a></iframe><p>Line 1 1==1 checks if the left-hand side value is equal to the right-hand side value, since both are numbers and equal it&#39;s true. Line 2 1==&quot;1&quot; checks if the left-hand side value is equal to the right-hand side value, either value gets explicitly <a href="https://www.freecodecamp.org/news/js-type-coercion-explained-27ba3d9a2839/">converted¹</a> resulting in true. Similarly, No issues would arise unless line number 12 because in line 12 it might seem to compare two empty arrays which are correct but actually we are comparing the references of two empty arrays resulting in false. Every conditional after Line number 12 is false because we are comparing reference(<em>pointer</em>) of two (objects/array) which are not equal.</p><h4>Why is that so?</h4><p>Everything boils down to the<a href="https://www.educba.com/primitive-data-types-in-javascript/"> <strong>datatype</strong>²</a> in <strong>JavaScript</strong>, Which is divided into <a href="https://www.geeksforgeeks.org/primitive-and-non-primitive-data-types-in-javascript/"><em>Primitive </em>and <em>Non-Primitive datatypes</em>³</a>. For ease of sake, we can say that <strong>values </strong>of the <strong>primitive data type</strong> are <strong>evaluated</strong>, whereas the <strong>reference(address, pointer)</strong> of the <strong>non-primitive data type</strong> is evaluated. For Example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7ab3ada110b060d6a8d596716e21fd0/href">https://medium.com/media/d7ab3ada110b060d6a8d596716e21fd0/href</a></iframe><p>As you can see when the value is compared (line 3) it returns true but when the address is compared(line 4) it returns false. Because the <strong>object </strong>is a non-primitive data type and the <strong>number </strong>is a primitive datatype.</p><h4>Why should we know it?</h4><blockquote>Under the hood, <strong>ReactJs </strong>inherits <strong>JavaScript </strong>and its <em>datatypes</em>, when a difference is <strong>conditional </strong>or <strong>state </strong>is detected by the react, it <strong>re-renders</strong> the components. That’s the core reason <strong>why conditionals matters in ReactJs</strong>.</blockquote><p>[1]: <a href="https://www.freecodecamp.org/news/js-type-coercion-explained-27ba3d9a2839/">JavaScript type coercion explained</a></p><p>[2:]: <a href="https://www.educba.com/primitive-data-types-in-javascript/">Primitive Data Types in JavaScript</a></p><p>[3]: <a href="https://www.geeksforgeeks.org/primitive-and-non-primitive-data-types-in-javascript/">Primitive and Non-primitive data types in JavaScript</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e92525410e0f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/seriea-pub/why-do-conditionals-matter-in-reactjs-vs-e92525410e0f">Why do conditionals matter in ReactJs == vs ===?</a> was originally published in <a href="https://medium.com/seriea-pub">Seriea Pub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Things to consider as a web developer]]></title>
            <link>https://medium.com/seriea-pub/things-to-consider-as-a-web-developer-e43c0903ba7?source=rss----d16af88cf8df---4</link>
            <guid isPermaLink="false">https://medium.com/p/e43c0903ba7</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Dibesh Raj Subedi]]></dc:creator>
            <pubDate>Sat, 30 Jul 2022 11:58:55 GMT</pubDate>
            <atom:updated>2022-07-30T11:58:55.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*BE8MkP2ZE8lbkgB-" /></figure><p>If you are willing to start your career as a web developer, you might be hustling with several blogs, articles, and videos. This article gives you a clear picture of where you should start to grow exponentially.</p><h4><strong>HTML/CSS</strong></h4><p>HTML/CSS plays a significant role in web development. You should know the basics of HTML before proceeding to CSS. HTML is mostly the skeleton of your project, whereas CSS is the skin. You can learn the basics of HTML from the following links.</p><ol><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML">HTML: HyperText Markup Language | MDN (mozilla.org)</a></li><li><a href="https://www.w3schools.com/html/default.asp">HTML Tutorial (w3schools.com)</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS: Cascading Style Sheets | MDN (mozilla.org)</a></li><li><a href="https://www.w3schools.com/css/default.asp">CSS Tutorial (w3schools.com)</a></li></ol><p>After your progress in CSS, you also should know <a href="https://sass-lang.com/documentation/">SASS </a>and CSS frameworks.</p><ol><li><a href="https://getbootstrap.com/docs/5.0/getting-started/introduction/">Introduction Bootstrap v5.0 (getbootstrap.com)</a></li><li><a href="https://tailwindcss.com/">Tailwind CSS: Rapidly build modern websites without ever leaving your HTML</a></li></ol><p>You can learn about other frameworks at <a href="https://hackr.io/blog/best-css-frameworks">Best CSS Frameworks for Front-End Developers in 2022 (hackr.io)</a></p><h4><strong>JavaScript</strong></h4><p>After the basics of HTML and CSS, you should understand that without JavaScript: animation, form submission, and many other kinds of stuff are a bit difficult. Follow the link below to understand JavaScript in depth.</p><ol><li><a href="https://www.w3schools.com/js/default.asp">JavaScript Tutorial (w3schools.com)</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/javascript">JavaScript | MDN (mozilla.org)</a></li></ol><h4><strong>TypeScript</strong></h4><p>As you might be familiar with all the basic coding approaches, you should also understand the basics of TypeScript. TypeScript is a superset of JavaScript with type definitions, meaning you can do everything similar to JavaScript, but you need to be type conscious like Java or C#. You can learn about typescript from the following link: <a href="https://www.typescriptlang.org/docs/">TypeScript: The starting point for learning TypeScript (typescriptlang.org)</a></p><h4><strong>NodeJS</strong></h4><p>NodeJS is a runtime environment, and you must know about NodeJs, its APIs, and hooks so that you can work on the server side as well using frameworks like <a href="http://expressjs.com/">ExpressJs</a>, <a href="https://nestjs.com/">NestJs</a>, etc. You can learn about NodeJs on <a href="https://nodejs.dev/learn/introduction-to-nodejs">Introduction to Node.js (nodejs.dev)</a>.</p><h4><strong>Package managers</strong></h4><p>While working on big projects, you can not write all code yourself? In such cases, you should use package managers like <strong>NPM</strong> and <strong>YARN</strong> to search for a relevant package that does the work for you. You can learn about NPM at <a href="https://docs.npmjs.com/">npm Docs (npmjs.com)</a>.</p><h4><strong>Compiler / Transpilers</strong></h4><p>You might think, “why do we need compiler/transpilers?” when we already have a node. Well, compilers and transpilers will assure your Js/Ts codes will be compiled for the desired platform with less effort. For example, JavaScript has different versions, which might not work for every browser. In such cases, transpilers like <strong>babel</strong> convert the code that the browser understands accordingly. You can learn about babel and Web pack at the following links:</p><ol><li><a href="https://babeljs.io/docs/en/">What is Babel? · Babel (babeljs.io)</a></li><li><a href="https://webpack.js.org/concepts/">Concepts | webpack</a></li></ol><h4><strong>Client-side rendering and Server-side rendering</strong></h4><p>Client Side Rendering simply means everything is calculated at the client’s end, whereas Server Side Rendering means the server uses a template engine to render the content and sends it to the client. <strong>React Js</strong> is a trending Js library that renders the contents on the client side, whereas <strong>Next Js</strong> is an extension of React, which supports Server-side rendering and a production-based framework. Follow the links below to learn more about React and Next.</p><ol><li><a href="https://reactjs.org/docs/getting-started.html">Getting Started — React (reactjs.org)</a> /<a href="https://www.w3schools.com/react/default.asp">React Tutorial (w3schools.com)</a></li><li><a href="https://nextjs.org/docs/getting-started">Getting Started | Next.js (nextjs.org)</a></li></ol><h4><strong>Version Control</strong></h4><p>When you write code, you cannot assure everything will go 100% right. And every time you make changes you will be overriding the files and will have no access to the history of your code. Using version control makes working in a team becomes easier along with maintaining a cloud backup and versions of your code. You can find the links from where you can learn about <strong>GitHub</strong> one of the most used version control systems.</p><ol><li><a href="https://docs.github.com/en/get-started/quickstart">Quickstart — GitHub Docs</a></li></ol><h4><strong>Project Management</strong></h4><p>When you start writing codes you might get overwhelmed with countless numbers of features and bugs that you encounter. To keep track of your process and shortcomings project management tools like <strong>Jira</strong> plays a significant role. You can learn about Jira at <a href="https://support.atlassian.com/jira-software-cloud/resources/">Jira Software Cloud resources | Jira Software Cloud | Atlassian Support</a>.</p><h4><strong>Searching for solutions</strong></h4><p>When you are stuck on any piece of code or logic you might google it but the chances of getting the correct solution will increase tremendously if you prefer <a href="https://stackoverflow.com/"><strong>Stack Overflow</strong></a><strong>.</strong> Sometimes you might not find the solution at stack overflow in such a case refer to GitHub issues or the documentation of the package itself if any. These few tips could save hours of web surfing and increase your productivity.</p><p>Feel free to leave a comment and see you in the next article.</p><p><a href="https://medium.com/@itsubedibesh">Dibesh Raj Subedi - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e43c0903ba7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/seriea-pub/things-to-consider-as-a-web-developer-e43c0903ba7">Things to consider as a web developer</a> was originally published in <a href="https://medium.com/seriea-pub">Seriea Pub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top JavaScript Concepts you should know before learning React JS]]></title>
            <link>https://medium.com/seriea-pub/top-javascript-concepts-you-should-know-before-learning-react-js-3c2987b7f082?source=rss----d16af88cf8df---4</link>
            <guid isPermaLink="false">https://medium.com/p/3c2987b7f082</guid>
            <category><![CDATA[js-concepts]]></category>
            <category><![CDATA[javascript-promise]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-concepts]]></category>
            <dc:creator><![CDATA[Apaar Dahal]]></dc:creator>
            <pubDate>Wed, 27 Jul 2022 14:55:48 GMT</pubDate>
            <atom:updated>2022-07-27T14:55:48.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOM5oOSu7WO0L-bMnB1uCA.png" /></figure><p>React JS is one of the most popular libraries among front-end developers and due to its popularity there is no doubt everyone wants to learn it. But before jumping directly into React JS, there are some JavaScript concepts you need to learn as you will use a lot of JavaScript when creating a web application using React JS.</p><p>In this article, I am going to skip the super basic stuff like declaring variables or introduction to functions because that’s implied that you need to know the basics of programming and language syntax.</p><p>I will go over things you need to know in JavaScript for you to be prepared to start learning React JS.</p><p><em>Let’s get started……</em></p><h4><strong>The Arrow Function</strong></h4><p>When you are working with React, you will find yourself working a lot with arrow functions. It is a new ES6 feature that has been used nearly frequently in recent codebases because it makes the code clean and readable. We can use this feature to write functions with a more concise syntax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*WHV6nEzMXYV7moA2a4z8Bw.png" /><figcaption>Normal JS function vs Arrow function</figcaption></figure><p>To replace normal functions with arrow functions, simply remove the function keyword and add the fat arrow function ‘=&gt;’ after ‘()’.</p><p>When passing parameters, parentheses are still required, however, they are optional if there is only one parameter.</p><h4><strong>Callback Function</strong></h4><p>A function that is passed to another function as a parameter is a callback function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*BhKvWrv0yHruK2BuzXdiWw.png" /></figure><p>Here, another function is called inside by the <strong><em>callbackExample()</em></strong> function, which accepts it as an argument. In JavaScript, this is acceptable and is referred to as a “callback.” Callbacks ensure that a function will run immediately following the completion of a task. It protects us from errors and issues while assisting us in writing asynchronous JavaScript code.</p><h4><strong>Map () Method</strong></h4><p>Map() method is one of the most used methods that iterates through an array and returns the elements in a new array after triggering a callback function on each element.</p><p>Let’s see an example…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*NquDAdq6JIdcATIJINo8Ww.png" /></figure><blockquote>Few things to note:</blockquote><blockquote>a. Even if the original array is empty, map() always makes a new array.</blockquote><blockquote>b. It doesn’t change the size of the original array.</blockquote><blockquote>c. When creating a new array, it always makes use of the values from your existing one.</blockquote><h4><strong>Promises</strong></h4><p>If you’re new to JavaScript, you might find it difficult to understand what a promise actually is. Let’s try to understand promises using a real-life example.</p><p>Let’s suppose that you are recently hired by a company and it&#39;s your first day. The manager comes over to you and asks you to complete an urgent task within an hour and you promise to report him as soon as you complete the given task.</p><p>Assuming the task is eventually completed and you report your manager back:</p><blockquote><em>“Successful, I have completed the task!”</em></blockquote><p>But if you could not complete the given task within an hour, you will report to your manager</p><blockquote>“Sorry, I could not complete the task within an hour.</blockquote><p>In the meantime, the manager sets the status of the task as PENDING until you work on it.</p><p>Once you complete the task means you were Successful. If you could not complete the task, it means Rejected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MfoBN78Qdj38YIOv1rc35g.png" /><figcaption>promise in javascript</figcaption></figure><p>Your promise to your manager to complete the task is synonymous with how we define a promise in JavaScript. The code doesn’t instantly or directly return a value. Instead, it gives back a promise that it will eventually deliver value.</p><p>JavaScript promises are asynchronous, which means they take some time to resolve or complete. Just as the task given takes time to complete. In addition, the JS engine doesn’t sit around doing anything; instead, it begins executing other sections of the code while waiting for the promise’s returned value.</p><p>Calling the Promise class and creating an object in the following way will allow you to define promises in JavaScript:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*ziZcHj3lHQ9_PmpywWG3Gw.png" /></figure><p>Running this in the console will return a Promise object:</p><h4><strong>Async/Await</strong></h4><p>This is supposedly a better approach to writing promises, and it helps in maintaining the clarity and cleanliness of our code. Any ordinary function can be made into a promise by simply adding the word asyncbefore it.</p><p>Before async/await, to make a promise we wrote this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*qMB6ttbhGFjWPAjK6amv-A.png" /></figure><p>Now using async/await, we write one like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*nSWeon5NXX9nLRz68-loNg.png" /><figcaption>async function</figcaption></figure><p>The keyword awaitmakes JavaScript wait until a promise settles and returns its result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*-hW4O0fguNotLVsgMoCmCg.png" /></figure><h4><strong>Destructuring</strong></h4><p>Unpacking the elements of an array or object is known as destructuring. Destructuring gives you the ability to manipulate and switch out elements after they have been unpacked depending on the operation you want to carry out. Destructuring makes it easy to extract only what is needed.</p><p>Here’s an example of how an array is destructured into variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*mG_rEQ7OuB6g6T5EjsjSCQ.png" /><figcaption>Example of array destructuring in JS</figcaption></figure><h4><strong>Other Concepts</strong></h4><p>Following are other JS concepts you need to know before writing your first React JS code.</p><p>a) Template literal</p><p>b) Error handling</p><p>c) Modules, import, export, babel</p><p>d) ES6 class keyword</p><p>e) Fetch API</p><p>These are the ones you might not really focus on while studying JavaScript even if there are so many more methods and ideas you should be aware of. Before learning React, you must understand these.</p><p>Thank you, Happy Coding.</p><p><a href="https://medium.com/@apaardahal">Apaar Dahal - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c2987b7f082" width="1" height="1" alt=""><hr><p><a href="https://medium.com/seriea-pub/top-javascript-concepts-you-should-know-before-learning-react-js-3c2987b7f082">Top JavaScript Concepts you should know before learning React JS</a> was originally published in <a href="https://medium.com/seriea-pub">Seriea Pub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React lazy and Suspense | Performance optimization in react]]></title>
            <link>https://medium.com/seriea-pub/react-lazy-and-suspense-performance-optimization-in-react-994dd1a0d3a1?source=rss----d16af88cf8df---4</link>
            <guid isPermaLink="false">https://medium.com/p/994dd1a0d3a1</guid>
            <category><![CDATA[suspense]]></category>
            <category><![CDATA[web-programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[lazy-loading]]></category>
            <dc:creator><![CDATA[Bee]]></dc:creator>
            <pubDate>Tue, 26 Jul 2022 16:25:53 GMT</pubDate>
            <atom:updated>2022-07-26T16:25:53.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVuEB8Dgf-bUCXxYfnDZLQ.jpeg" /></figure><p>Each module or component will merged into a single file called bundle, which includes our whole webpage. But, as app grow bigger and bigger the initial loading time increase drastically, which create impact on user experience, SEO and all.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*qXSdaSUBr8piq51MQ86QGA.png" /></figure><p>When webpack sees these kind of import it just bundles them all together because we want to include them statically all together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yl7S7iGRMn_ChLmttDVbQw.png" /><figcaption>During initial loading of app all chunk is downloaded from server</figcaption></figure><p><strong><em>Dynamic imports</em></strong></p><p>Dynamically import means we only want to import file and then load it when necessary. One of the ways to split a code is using <em>dynamic imports.</em> To get feature of dynamic import in React, usually referred as route-based code-splitting, we use React lazy. But there are tons of popular package for code-splitting in React component called react-loadable and more.</p><h3>React lazy</h3><blockquote>React lazy make easier to create components that are loaded using dynamic import() but rendered like normal components.</blockquote><p>In react lazy we’re able to wrap our components inside of the lazy function that we got from react and we are able to use in react router because react-router default support code splitting which is what we’re trying to do split up our code into chunks. We will just end up replacing any place where we have route components with these new lazy loaded components.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNocq8Ca-xsnMgp9JI4x2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZP07QrsPZm6hvMMOc69omw.png" /><figcaption>Decrease in first script load size while initially loaded</figcaption></figure><p>What will end up happening is that whenever user navigates to this route their we actually load this route webpack ahead of time during build step will have already chunked our code accordingly using that new lazy loaded function so that what happens is when they hit profile page they get profile page chunk. When they hit about page they get about page chunk. <strong>We actually can use them wherever there is route.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zUoOQcPOR3dJxE4ZynqwqA.png" /><figcaption>Load script when route is changed</figcaption></figure><p>The moment we need about page we pull about page from backend and lazy loaded to this route. So this is actually cool because we’re using react router. We get this route level loading right out of the box with react lazy and react router.</p><blockquote>When we check out in network we see our chunk broken into two or more.</blockquote><blockquote><strong>Now our page will be faster because our initial loading only dealed with smaller chunks. Less JS means our initial loading of our app is fast.</strong></blockquote><p>The problem is because these are synchronous during the given route, there might not be pages we want which depends on how fast our server is. If our server is slow, when we request for hour homepage, user might not see anything. So to eliminate these problem we can use <strong>React Suspense.</strong></p><h3>React Suspense</h3><blockquote>React suspense is for wrapping lazy loaded components.</blockquote><p>Suppose a new component that react has released that allows you to wrap any part of our application that might be rendering asynchronous components which is lazy loaded components. Now we wrap suspense to our router.</p><p>Suspense, just render our fallback component and waits until components is finished being lazy loaded then it will automatically switch to right component for us.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g__ZMAR10Gl4tvP9q2YDig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DnRrPCMsLc-iL-PrhfjdaA.png" /><figcaption>During route change it wait for component to completely loaded</figcaption></figure><p><em>P.S: You can use Loader or Spinner in these alternatives</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*NCtxWfkdJmTOetrbmGoW3A.png" /><figcaption>For this test we change our network to Slow 3G</figcaption></figure><p>Because app is small we don’t see extreme differences so for this test we change to slow connection to display fallback component.</p><p>Hence, with the help of react lazy and suspense our page will be faster because there is less initial loading and we only download the needed script. Again, Less JS means our initial loading of our app is faster.</p><p>Thank you! for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=994dd1a0d3a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/seriea-pub/react-lazy-and-suspense-performance-optimization-in-react-994dd1a0d3a1">React lazy and Suspense | Performance optimization in react</a> was originally published in <a href="https://medium.com/seriea-pub">Seriea Pub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CRUD operation in Angular]]></title>
            <link>https://medium.com/seriea-pub/crud-operation-in-angular-50e9e77a1545?source=rss----d16af88cf8df---4</link>
            <guid isPermaLink="false">https://medium.com/p/50e9e77a1545</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[crud]]></category>
            <dc:creator><![CDATA[Sudip Bhattarai]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 11:40:58 GMT</pubDate>
            <atom:updated>2022-07-25T11:41:04.127Z</atom:updated>
            <content:encoded><![CDATA[<p>Angular is a web application framework of typescript which is used to make Single Page Interface. Angular is one of the most popular framework for the web developer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McfmtBgRI9eOKmbU8Hv1ng.png" /><figcaption><a href="https://angular.io/"><strong>Angular Logo</strong></a></figcaption></figure><h4>Creating a new App</h4><p>Hope you have installed the node if not not worries you can download it through <a href="https://nodejs.org/en/">here</a>.</p><p>After node has been installed in your computer you have to install angular cli from command prompt or terminal .You can install it by using the following command.</p><blockquote><strong>npm install -g @angular/cli</strong></blockquote><p>Yeah, One Step Closer To The Goal</p><h4>Creating a New App:</h4><p>You don’t have to create the app from the scratch. Rather you can change from whatever is there so that both time and resources is used less. You can create app by using the following command.</p><blockquote>ng new my-app</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*-bN_GwnDgrRvN3P9_vf98A.png" /></figure><p>Great there you go. In place of app-name we have latter made Restaurant-App. This is just the name so make changes as you wish.</p><p>You can now run the application with the help of following command.</p><blockquote>ng serve</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*qyHlOgA1keOLHkqd5BcWSA.png" /></figure><p>We can see our changes in localhost:4200.</p><h4>Components, What actually is this:</h4><p>Components are the building blocks of application in angular. Here, we divide each and every big blocks of UI into many components which could be used in future also. This definitely reduce the time to write the code which is very effective in creating a web based application.</p><p>To create a components in angular, we can simply write the following command in the terminal.</p><blockquote>ng g c component-name</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*6dIYf9NlZ7gbFSmEl3vjFw.png" /></figure><h4>CRUD Operation In Angular</h4><p>Now, lets go to our main goal i.e. to make the CRUD operation. After creating components and in that components you have done html and done the styling. You have to make operations so that the users can interact to the web page and in the same time can add, read, change and delete the details provided by them.</p><p>We can create the new post by following code. Here, we first created the component named Restaurant-Dash. After that, we done the HTML part and the CSS part which you can do it by yourself. After that make sure you make a service which can be made by using following code.</p><blockquote>ng g s service-name</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*iAViHzwsAg9bbmRyJ8zgcA.png" /></figure><p>So how will the folder looks likes???</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/1*7meZ_KFuZIdl-LiGdvsX5Q.png" /></figure><p>Here, service-name is api which you could name any. To make sure your that it is is new folder we have placed in new folder named shared which you can make any.</p><p>Now let’s do some code.</p><p>I hope you know how to make form in HTML. In my form I have add some of the fields like email, address, mobile and service and we have used Form Builder as well to bind the form. After writing this you can …</p><p>Write this code in component in my case it is Restaurant-Dash in .ts file.</p><p><em>addRestro(){</em></p><p><em>this.restaurantModelObject.name=this.formValue.value.name</em></p><p><em>this.restaurantModelObject.email=this.formValue.value.email</em></p><p><em>this.restaurantModelObject.address=this.formValue.value.address</em></p><p><em>this.restaurantModelObject.mobile=this.formValue.value.mobile</em></p><p><em>this.restaurantModelObject.service=this.formValue.value.service</em></p><p><em>this.api.postRestaurant(this.restaurantModelObject).subscribe(res=&gt;{</em></p><p><em>alert(“This is added successfully”)</em></p><p><em>this.formValue.reset()</em></p><p><em>this.getAllData() //to show the data as soon as ok is clicked</em></p><p><em>}</em></p><p>And write this in your service.ts in my case it is api.service.ts. Import the HttpClient. Also initialize in constructor.</p><p><em>postRestaurant(data:any){</em></p><p><em>return this._http.post&lt;any&gt;(“http://localhost:3000/posts&quot;,data).pipe(map((res:any)=&gt;{return res}))</em></p><p><em>}</em></p><p>Here we have fetch the data from localhost for that we have used HttpClient Module.</p><h4>Hence, Create is completed.</h4><p>Similarly for rest of the operation we can do this by:</p><p><em>getAllData(){</em></p><p><em>this.api.getRestaurant().subscribe(res=&gt;{return this.allRestaurant=res})}</em></p><p><em>deleteRestro(data:any){this.api.deleteRestaurant(data.id).subscribe(res=&gt;{</em></p><p><em>alert(“delete”)</em></p><p><em>this.getAllData()})}</em></p><p><em>editRestro(data:any){</em></p><p><em>this.showAdd=false;</em></p><p><em>this.showBtn=true;</em></p><p><em>this.restaurantModelObject.id=data.id</em></p><p><em>this.formValue.controls[‘name’].setValue(data.name)</em></p><p><em>this.formValue.controls[‘email’].setValue(data.email)</em></p><p><em>this.formValue.controls[‘address’].setValue(data.address)</em></p><p><em>this.formValue.controls[‘mobile’].setValue(data.mobile)</em></p><p><em>this.formValue.controls[‘service’].setValue(data.service)</em></p><p><em>}</em></p><p><em>updateRestro(){</em></p><p><em>this.restaurantModelObject.name=this.formValue.value.name</em></p><p><em>this.restaurantModelObject.email=this.formValue.value.email</em></p><p><em>this.restaurantModelObject.address=this.formValue.value.address</em></p><p><em>this.restaurantModelObject.mobile=this.formValue.value.mobile</em></p><p><em>this.restaurantModelObject.service=this.formValue.value.service</em></p><p><em>this.api.updateRestaurant(this.restaurantModelObject,this.restaurantModelObject.id).subscribe(res=&gt;{</em></p><p><em>alert(“Update successfull”)</em></p><p><em>this.formValue.reset()</em></p><p><em>this.getAllData()})}</em></p><p>In service.ts place this.</p><p><em>getRestaurant(){return this._http.get&lt;any&gt;(“http://localhost:3000/posts&quot;).pipe(map((res:any)=&gt;{return res}))}</em></p><p><em>updateRestaurant(data:any,id:number){return this._http.put&lt;any&gt;(“http://localhost:3000/posts/&quot;+id,data).pipe(map((res:any)=&gt;{return res}))}</em></p><p><em>deleteRestaurant(id:number){return this._http.delete&lt;any&gt;(“http://localhost:3000/posts/&quot;+id).pipe(map((res:any)=&gt;{return res}))}</em></p><p><strong>Well Done!!! You have made the CRUD application to interact to the user.</strong></p><p>Thank You.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50e9e77a1545" width="1" height="1" alt=""><hr><p><a href="https://medium.com/seriea-pub/crud-operation-in-angular-50e9e77a1545">CRUD operation in Angular</a> was originally published in <a href="https://medium.com/seriea-pub">Seriea Pub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started-NestJs]]></title>
            <link>https://medium.com/seriea-pub/getting-started-nestjs-9ed8f2f5ca30?source=rss----d16af88cf8df---4</link>
            <guid isPermaLink="false">https://medium.com/p/9ed8f2f5ca30</guid>
            <dc:creator><![CDATA[Yadavpiyushkp]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 09:39:25 GMT</pubDate>
            <atom:updated>2022-07-25T10:58:36.017Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BInq_WVVEi5mEtM1m3PrVQ.png" /><figcaption>NestJS</figcaption></figure><p><strong>Intro</strong></p><p><em>Nest (NestJS) is a framework that is used to create effective, scalable Node.js server-side applications. It mixes features of OOP (Object Oriented Programming), FP (Functional Programming), and FRP(Functional Reactive Programming). It also employs progressive JavaScript and is built with and fully supports TypeScript (yet still allows developers to create in plain JavaScript).</em></p><p><strong>Pre- Requisites</strong></p><ul><li>Good to go when you have experience with Modern javaScript, Node.js, ExpressJs, and Typescript.</li><li>Install NodeJs and NPM(Node Package Manager) from <a href="https://nodejs.org/en/">here</a>.</li></ul><p><strong>Setup</strong></p><p>Nest Command Line Interface will help to easily set up the project. Using Node package manager, try these commands in the os command terminal.</p><pre>npm i -g @nestjs/cli</pre><p>Or, if you’re using the yarn package manager.</p><pre>yarn global add @nestjs/cli</pre><p>Now, to create a new project.</p><pre>nest new project-name</pre><p>After creating this file structure boilerplate will look like this,</p><figure><img alt="Project Structure" src="https://cdn-images-1.medium.com/max/384/1*FRHvxp7hcO1W1xOYSkMyaA.png" /><figcaption>File Structure</figcaption></figure><p>Quick summary of file structure.</p><ul><li><strong>node_modules</strong>: Holds the project dependency package installed and managed by package.json</li><li><strong>src</strong>: This is where the real game begins, this is where we start to edit the source code. Let’s break down the src/ directory to understand it better.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*oYDoDLhwmyzQQmdMUw4V4Q.png" /><figcaption>src/ Directory</figcaption></figure><pre>app.controller.ts <strong>(Controller For The Route,The routes that can be defined using &quot;@</strong><a href="http://twitter.com/Controller"><strong>Controller</strong></a><strong>&quot; and other REST methods, such as (@</strong><a href="http://twitter.com/Get"><strong>Get</strong></a><strong>, @</strong><a href="http://twitter.com/Post"><strong>Post</strong></a><strong>, @</strong><a href="http://twitter.com/Put"><strong>Put</strong></a><strong>, @</strong><a href="http://twitter.com/Patch"><strong>Patch</strong></a><strong>, @</strong><a href="http://twitter.com/Delete"><strong>Delete</strong></a><strong>), are stored there.</strong><strong>)</strong></pre><pre>app.controller.spec.ts <strong>(Unit Test For The Controller)</strong></pre><pre>app.module.ts <strong>(Root Module Of The Application, Everything you add here will function as a Module, which is where the concept of modularization enters the picture. As you can see, we are utilizing the &quot;@</strong><a href="http://twitter.com/Module"><strong>Module</strong></a><strong>&quot; keyword, a decorator imported from NestJS, in this sentence.</strong><strong>)</strong></pre><pre>app.service.ts <strong>(It contains a service that will be utilized in controllers, therefore anything written here can be used in a controller. You can also provide some private helper functions here that are only accessible within the class</strong>.<strong>)</strong></pre><pre>main.ts <strong>(Entry Point of The Appliacation,Gets Compiled To JavaScript on Runtime)</strong></pre><ul><li><strong>test</strong>: Here, you can write your own end-to-end testing.</li><li><strong>nest-cli.json</strong>: It contains a NestJS CLI setup. If you wish to change your source directory to another directory, you can do it from here by changing “source root.”</li><li><strong>package.json: </strong>As always the heart of the project is for dependency management, and some basic scripts to run the project.</li><li><strong>tsconfig.json</strong>: Holds all the typescript configuration, to learn more about it <a href="https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#using-tsconfigjson-or-jsconfigjson">here.</a></li></ul><p><strong>Some Pre-Configured Commands</strong></p><pre>npm run start:dev (<strong>To run Application in development mode)</strong></pre><pre>npm run start:build (<strong>To Create a Production Build of Application)</strong></pre><pre>npm run start:prod (<strong>To run Application in Production Mode, which requires build first)</strong></pre><pre>npm run format, npm run lint(<strong>To Reformat Codebase)</strong></pre><pre>npm run test (<strong>To run your end-to-end test cases for the appliaction that you have developed)</strong></pre><p><strong>Conclusion</strong></p><p><em>Thanks for stopping by, if you like please leave 👏 and feel free to respond if you need any help. Follow my team at </em><a href="https://medium.com/seriea-pub"><em>https://medium.com/seriea-pub</em></a><em> to get more updates on different software development topics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ed8f2f5ca30" width="1" height="1" alt=""><hr><p><a href="https://medium.com/seriea-pub/getting-started-nestjs-9ed8f2f5ca30">Getting Started-NestJs</a> was originally published in <a href="https://medium.com/seriea-pub">Seriea Pub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When to useCallback & useMemo hooks ?]]></title>
            <link>https://medium.com/seriea-pub/when-to-usecallback-usememo-hooks-8faf2682bf0c?source=rss----d16af88cf8df---4</link>
            <guid isPermaLink="false">https://medium.com/p/8faf2682bf0c</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Bee]]></dc:creator>
            <pubDate>Fri, 22 Jul 2022 16:22:15 GMT</pubDate>
            <atom:updated>2022-07-22T16:22:15.090Z</atom:updated>
            <content:encoded><![CDATA[<h3>When to useCallback &amp; useMemo hooks ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B7MBvsVyrKegVy2eTYOjCw.jpeg" /></figure><p>Performance is very common thing that every developer may faces at some point after building the application. We architect, code and build the system which run perfect in our system but when it goes for production or after we deploy the system it actually feels slower than that of development.</p><h3>So why is development app feels faster than of production?</h3><p>During development, all our files are hosted in our local machine or our own computer which is specifically in local port 3000(in React). It is very efficient and fast for us to download all of our bundles and files because we were just developing locally and the speed is really quick where the speed of the internet connection doesn’t real concerns. But in production internet comes the big issue especially if we are building applications for the country that have really slow internet connections.</p><h3>Do not fall for tips and tricks!</h3><blockquote>“Performance optimization always comes with a cost but does not always come with benefit”</blockquote><p>So, do not optimize your code ahead of time or before it really needs, don’t write performance code, and <strong>don’t fall for all the performance tips and tricks </strong>that we read all over the internet without proper reason to do so. We only optimize a code once there is a production or we really feel some line of code is making slow unless it is mandatory. We shouldn’t be eagerly optimizing our code and implementing what we read without necessary.</p><h3>Why ?? Not to implement tricks</h3><p>Your code might not be slow to begin the optimization. We will optimize the code by measuring it in the first place. If we don’t measure and start optimization stop doing it. Only perform optimization when you notice the application starts to slow down and you notice there is a problem. Before looking for the potential solution find out why it is slowing down.</p><p>Don’t over-optimize the application because when we optimize the code actually it makes slower. Optimizing the code means adding the lines of code where every line of code come with a cost.</p><h3>useCallback | Hook</h3><p>useCallback help to memoize the function that we wrap in.</p><p>In REACT when the parent component re-renders inside the parent, a child component also re-renders. At each re-render, the child component will re-execute its functions. <strong>Using the call-back function</strong>, the re-execute of the function will solve the issue.</p><p>Example 1.1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VbP4Pv3KhTD0RzMdktGOkQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*K6K0ruOkKyMZgK5CODyP3w.png" /><figcaption>Output of Example 1.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*oxabXEwoHgYdd8mRhd2Cwg.png" /><figcaption>console log of Example 1.1 after clicking “Add value by 10” 5 times</figcaption></figure><p>As we can see in the above console the more we click the button, the component get re-renders and functions get called which is unnecessary and costly for us. So, to prevent this unnecessary calling of function, we memoize it.</p><p>Example 1.2 (After implementing callback)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7wchpncQOq9b6uRTNCJmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*K6K0ruOkKyMZgK5CODyP3w.png" /><figcaption>Output of Example 1.2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*VNw8IVzwd9sl3lH92OdrdA.png" /><figcaption>console log after implementing callback and clicking button 5 times</figcaption></figure><p>As we can see in the console there is no more unnecessary re-render due to the help of useCallback hook.</p><h3>useMemo | Hook</h3><p>useMemo returns a memoized value.</p><p>It is suitable for processing a lot of data i.e. complex mathematical calculations or any complex task that takes time to calculate. First, it will do work at the first render and then on every re-render it <strong>displays the cached version </strong>rather than calculating the complex calculation again and again.</p><p>Example 2.1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGfJLhOzS9_QuKYioSCqpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*2yH3QZhIoOzrTj1O70DW2g.png" /><figcaption>Outpout of Example 2.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*57dF1TcPMogGJ_cqbyqn1w.png" /><figcaption>console log of Example 2.1 after clicking random button 5 times</figcaption></figure><p>As we can see the unnecessary complex calculation is performed again and again which is costly if that function takes more than a second. So, to eliminate these unnecessary calculations we memoized the value with the help of useMemo.</p><p>Example 2.2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYQ1WpFtDxiheclI2HfEAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*ICEbtyrTBsT1uz6zx06_Dg.png" /><figcaption>Output of Example 2.2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*hfp-SpQPT3S4LV7Y7pKmKg.png" /><figcaption>console log of Example 2.2 after clicking Random button 5 times</figcaption></figure><p>As we can see… complexFunctions() is not being called because of useMemo hooks which are very efficient for complex calculations.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8faf2682bf0c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/seriea-pub/when-to-usecallback-usememo-hooks-8faf2682bf0c">When to useCallback &amp; useMemo hooks ?</a> was originally published in <a href="https://medium.com/seriea-pub">Seriea Pub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>