<?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 Javid Salim on Medium]]></title>
        <description><![CDATA[Stories by Javid Salim on Medium]]></description>
        <link>https://medium.com/@cavidselimov.cs?source=rss-2756c4d1a759------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VQ9-cSs9HCLALi55tqIODA.jpeg</url>
            <title>Stories by Javid Salim on Medium</title>
            <link>https://medium.com/@cavidselimov.cs?source=rss-2756c4d1a759------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 08:03:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cavidselimov.cs/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[Memoization: A Powerful Technique in JavaScript]]></title>
            <link>https://medium.com/@cavidselimov.cs/memoization-a-powerful-technique-in-javascript-92c7b5c46615?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/92c7b5c46615</guid>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Sun, 18 Jun 2023 09:44:12 GMT</pubDate>
            <atom:updated>2023-06-18T09:44:12.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*967tChQYqd32YkZo6w4lHQ.png" /></figure><p>Read in English</p><p><a href="https://github.com/javidselimov/jsworldjs#memoization">GitHub - javidselimov/jsworldjs: JavaScript Translation Repository: A collection of translated Medium articles about JavaScript, offering insights and tutorials in multiple languages. Contribute your translations to make JavaScript knowledge accessible to a global audience. Happy coding and happy translating!</a></p><blockquote><strong>JavaScript müsahibələri dünyasında Memoization anlayışı tez-tez ortaya çıxır və tərtibatçıları problem həll etmə bacarıqlarını nümayiş etdirməyə yönəlmiş bir sualdır. Təxminən 7–8 dəqiqəlik müsahibə vaxtı sərf edərək probleminin effektiv həllini təqdim etmək, xüsusən də orta səviyyədə olan bir tərtibatçının səriştəsinin güclü göstəricisi ola bilər. Memoization bir vaxtlar əl ilə həyata keçirilən bir texnika olsa da, React kimi müasir frameworklar və kitabxanalar bu problemi asanlıqla həll etmək üçün öz hook və mexanizmlərini təqdim etdilər. Bununla belə, bu məqalədə biz yalnız bu güclü texnikanın JavaScript ilə tətbiqinə diqqət yetirəcəyik. Memoizasiya dünyasına getməyə hazır olun və peşəkar kimi performansı optimallaşdırmağı öyrənin.</strong></blockquote><p>Nümunəyə baxaq:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbztBd-LCT4L5clQkWAoXw.png" /></figure><p>kod xüsusi açar yaratma yanaşmasından istifadə edərək memoizing funksiyasının həyata keçirilməsini nümayiş etdirir. Budur kodun izahı:</p><p>Yadda saxlanılan funksiyanın neçə dəfə çağırıldığını izləmək üçün sayğac dəyişəni işə salınır.</p><p>Arqument kimi geri çağırış funksiyasını qəbul edən Memo funksiyası müəyyən edilmişdir.</p><p>Memo funksiyasının daxilində keşləşdirilmiş nəticələri saxlamaq üçün cash obyekti yaradılır. Bu obyekt keşlənmiş dəyərlər üçün unikal açar-dəyər cütlərini saxlayacaq.</p><p>Memo funksiyası …args spread operatorundan istifadə edərək istənilən sayda arqumentləri qəbul edən yeni funksiya qaytarır.</p><p>Qaytarılan funksiya daxilində açar args.join(‘-’) metodundan istifadə edərək arqumentləri defislə birləşdirərək yaradılır.</p><p>Funksiya açarın cash obyektində artıq olub olmadığını yoxlayır. Əgər belədirsə, o, həmin açarla əlaqəli keşlənmiş dəyəri qaytarır.</p><p>Əgər açar cash obyektində tapılmazsa, o, geri çağırış (…args) istifadə edərək təqdim edilmiş arqumentlərlə orijinal geri çağırış funksiyasını işə salır. Nəticə açarla cash obyektinə təyin edilir.</p><p>Hər dəfə orijinal geri çağırış funksiyası çağırıldıqda sayğac dəyişəni artırılır.</p><p>Nəhayət, açara uyğun keşlənmiş nəticə qaytarılır.</p><p>Təqdim olunan nümunə eyni arqumentlərlə yadda saxlanılan funksiyaya çoxsaylı çağırışları nümayiş etdirir. Funksiya lazımsız hesablamalardan qaçaraq dublikat call üçün keşlənmiş nəticəni alır. Sayğac dəyişəni orijinal funksiyanın çağırış sayını izləmək üçün də istifadə olunur, bu funksiya çağırışlarının azaldılmasında memoizingin faydalarını göstərir.</p><p>Nəzərə alın ki, bu tətbiq memoizing funksiyaya ötürülən arqumentlərin seriallaşdırıla biləcəyini və heç bir problem olmadan defisdən istifadə etməklə birləşdirilə və ya sətirə çevrilə bilən olaraq nəzərdə tutur.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92c7b5c46615" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DEPENDENCY INJECTION in JAVASCRIPT]]></title>
            <link>https://medium.com/@cavidselimov.cs/dependency-injection-in-javascript-21cec9a573df?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/21cec9a573df</guid>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[typescript-di]]></category>
            <category><![CDATA[javascript-di]]></category>
            <category><![CDATA[js-dependency-injection]]></category>
            <category><![CDATA[dit]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 07:09:53 GMT</pubDate>
            <atom:updated>2023-06-13T11:24:43.067Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*NRwdLyQ-kuWeg7MnuYcULQ.png" /></figure><p>Read in ENGLISH</p><p><a href="https://github.com/javidselimov/jsworldjs#dependency-injection">https://github.com/javidselimov/jsworldjs#dependency-injection</a></p><p>Müasir proqram təminatının işlənib hazırlanmasında asılılıqların səmərəli şəkildə idarə edilməsi davamlı tətbiqlər yaratmaq üçün çox vacibdir. Buna nail olmağa kömək edən bir texnika Dependency Injection dur (DI). Bu yazıda biz DI anlayışını araşdıracağıq, JavaScript-də qabaqcıl nümunələri baxacaq və onun TypeScript-də alternativ tətbiqinə toxunacağıq.</p><p>DI başa düşək: DI, asılılıqların yaradılması və idarə edilməsini təşviq edən dizayn nümunəsidir. Asılılıqlarını daxili olaraq quran bir sinif əvəzinə, asılılıqlar xaricdən təmin edilir və daha yaxşı çevikliyə imkan verir.</p><p><em>JavaScript-də Dİ-nin bir neçə qabaqcıl nümunəsinə nəzər salaq:</em></p><p>Konstruktor inyeksiyası: Konstruktor inyeksiyası onun konstruktoru vasitəsilə sinfə asılılıqların ötürülməsini nəzərdə tutur. Nümunə:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5NBso3EMwhVDDhsKZyuOQ.png" /></figure><p>Property inyeksiyası: Property inyeksiyasında asılılıqlar sinif xassələrinə təyin edilir. Bu yanaşma istəyə bağlı asılılıqlarla məşğul olduqda faydalıdır. Aşağıdakı misalı nəzərdən keçirək:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*AR7DYbDOEc2vQIn_j5cI4Q.png" /></figure><p>Metod inyeksiyası: Metod inyeksiyası asılılıqların sinif metodlarına arqument kimi ötürülməsini nəzərdə tutur. Bu yanaşma asılılıqların seçmə inyeksiyasına imkan verir. Numuneye baxaq:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L0nvgjDPfYXQ4hLgbGVqLg.png" /></figure><p>TypeScript dekoratorlar və interfeyslər üçün dəstəyi vasitəsilə asılılıq inyeksiyası üçün əlavə funksiyalar təqdim edir. TypeScript istifadə edərək alternativ yanaşmanı araşdıraq:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LjoNKZF7Q495gq1fFBaI4A.png" /></figure><p>JavaScript-də biz Dİ inkişaf etmiş nümunələrini araşdırdıq, o cümlədən konstruktor inyeksiyası, property inyeksiyası və metod inyeksiyası ilə tanış olduq. Bundan əlavə, biz dekoratorlar və interfeyslərdən istifadə edərək TypeScript-də alternativ tətbiqi müzakirə etdik. Bu üsullardan istifadə kod bazanızın arxitekturasını və keyfiyyətini əhəmiyyətli dərəcədə yaxşılaşdıra bilərsiniz.</p><p>Unutmayın ki, asılılıq inyeksiyasının tətbiqi kodun təkrar istifadəsini və texniki cəhətdən təmiz və modulyar dizaynlara imkan verir, daha səliqəli və genişlənə bilən struktura gətirib çıxarır.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21cec9a573df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of new.target in JavaScript: An Epic Adventure of Quirky Variable Names]]></title>
            <link>https://medium.com/@cavidselimov.cs/unleashing-the-power-of-new-target-in-javascript-an-epic-adventure-of-quirky-variable-names-b08a18d5d4c?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/b08a18d5d4c</guid>
            <category><![CDATA[javascript-weird]]></category>
            <category><![CDATA[new-target]]></category>
            <category><![CDATA[awesome-javascript]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Sat, 27 May 2023 12:54:11 GMT</pubDate>
            <atom:updated>2023-05-27T16:50:26.015Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*oplPFew7c-9GiHPzAuKRzw.png" /></figure><blockquote><strong>This is also available in other languages</strong></blockquote><p><a href="https://github.com/javidselimov/jsworldjs">https://github.com/javidselimov/jsworldjs</a></p><p><em>Introduction:</em></p><p>JavaScript is a realm of wonders and mysteries, filled with hidden gems that await discovery. One such gem is the new.target property, a special and enchanting feature that allows us to unravel the secrets of constructors and their derived classes. In this epic article, we embark on a journey through the realm of new.target, with a touch of humor and whimsical variable names that will make you chuckle.</p><p><em>The Mysterious </em><em>new.target Property:</em></p><p>Let us introduce you to our first hero, new.target. It is a property that is automatically defined within the scope of a constructor function or method when it is invoked with the new keyword. This magical property holds a reference to the constructor or class that was directly invoked, enabling us to understand the true origins of an instance.</p><p><em>The Great Constructor Quest:</em></p><p>Imagine we have a fantastical land of creatures known as “Animals,” each with their unique abilities and characteristics. Our constructors are named in a rather whimsical fashion, adding a touch of mirth to our tale. Let’s meet our heroes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWBRHdK-hJUZ2l39ToNU-g.png" /></figure><p>In the above example, when we create an instance using new Animal(), the new.target property within the constructor will refer to the Animal constructor itself. However, if we create an instance using a derived class, such as new Dog(), the new.target property will point to the derived class instead.</p><p><em>Deriving Marvelous Creatures:</em></p><p>Now, let’s introduce a derived class named Dog that inherits from our beloved Animal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzsbcMFkysQfxYFNougPpQ.png" /></figure><p>When we create a new instance of Dog using new Dog(), the constructor is executed. As a result, both the Animal and Dog constructors are invoked in a cascading manner. With the help of new.target, we can differentiate between instances of Animal and Dog, unraveling the secret behind their creation.</p><p><em>The Mighty Summoner:</em></p><p>But wait, there’s more! The power of new.target extends beyond constructors. It can also be utilized within static methods and non-constructor functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGUVNJAijHItdcdAx9_v5w.png" /></figure><p>In this peculiar function, when we call summonAnimal() directly, new.target will be undefined. However, if we use new summonAnimal(), new.target will refer to the function itself, indicating that it was invoked as a constructor.</p><p><em>Disclaimer:</em></p><p>The variable names used in this article were chosen for their humorous effect and do not represent best practices for production code. It’s important to use meaningful and descriptive variable names in real-world projects to enhance code readability and maintainability.</p><p>Now, let’s delve even deeper into the captivating world of new.target with a more advanced example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zs3Z5swTmroPz1CLAmavEA.png" /></figure><p>In this spellbinding example, we have the Magician and Warlock classes. When we create a new instance of Magician using new Magician(), the new.target property within the constructor will refer to the Magician constructor itself. Similarly, when we create an instance of Warlock using new Warlock(), the new.target property will point to the derived class, Warlock.</p><p>Additionally, both the Magician and Warlock classes have a castSpell() method. The method checks the value of new.target to determine whether it was called directly or as part of a derived class. This allows us to perform different actions based on the invoking context.</p><p>Now, let’s witness the magic in action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVNwSRN459R89cXFM1gNWw.png" /></figure><p>As you can see, the new.target property enables us to distinguish between direct and derived class invocations, allowing us to tailor the behavior of our code accordingly.</p><p><em>Conclusion:</em></p><p>Through our journey into the captivating world of new.target, we have witnessed the power it holds in unraveling the origins of constructors and classes. While we&#39;ve added a touch of humor with quirky variable names, it&#39;s essential to maintain professionalism and adhere to best practices when writing production code.</p><p>So go forth, fellow developers, and wield the power of new.target responsibly. May your code be both enchanting and robust, creating magical experiences for your users!</p><p>Happy coding, my fellow sorcerers of the JavaScript realm!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b08a18d5d4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of Closures in JavaScript: Implementing the Singleton Design Pattern]]></title>
            <link>https://medium.com/@cavidselimov.cs/the-power-of-closures-in-javascript-implementing-the-singleton-design-pattern-f1ee81a227fc?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1ee81a227fc</guid>
            <category><![CDATA[closure-vs-singleton]]></category>
            <category><![CDATA[iife]]></category>
            <category><![CDATA[sigleton-design-pattern]]></category>
            <category><![CDATA[closure]]></category>
            <category><![CDATA[javascript-closure]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Wed, 10 May 2023 10:54:02 GMT</pubDate>
            <atom:updated>2023-05-10T10:54:02.184Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Yy4wbUijuVY-WNx0o34tbw.png" /></figure><p>Recently, one of my students asked me why closures are important in JavaScript. This is an excellent question, and one that is often asked by developers who are new to the language. In this article, I will explain what closures are and why they are important using the Singleton design pattern as an example.</p><p>First, let’s define what a closure is. A closure is a function that has access to variables in its outer scope, even after the outer function has returned. In simpler terms, it’s like a backpack that a function carries with it when it returns. The backpack contains all the variables that the function needs to remember. This feature makes closures extremely useful for a variety of purposes, including implementing design patterns.</p><p>Now, let’s talk about the Singleton design pattern. This pattern is used to ensure that only one instance of a class is ever created. This is useful when dealing with resources like databases or network connections, where having multiple instances can cause problems.</p><p>To implement the Singleton pattern using closures, we can create a closure that stores the single instance of the class. This closure will have a private variable that stores the instance and a public method that returns the instance. Let’s take a look at the code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*gUUNzjqQzLmev3gXB3hbUA.png" /></figure><p>In this code, we are creating an immediately invoked function expression (IIFE) that returns an object with a single method called getInstance. The getInstance method checks if the instance has already been created and if not, it creates a new instance of the class. Finally, it returns the instance.</p><p>Using this pattern, we can ensure that only one instance of the class is ever created and that it is shared across all parts of the application that need to use it. This can help to reduce the amount of memory and resources that are used by the application, as well as improve performance.</p><p>In conclusion, closures are an important feature of JavaScript that allows us to create private variables and functions that are only accessible within a particular scope. Using closures, we can implement design patterns like the Singleton pattern, which can greatly improve the quality and efficiency of our code. I hope this article has helped you to understand the importance of closures in JavaScript and how they can be used to implement powerful patterns like the Singleton pattern.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1ee81a227fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Webpack vs. Vite: A Comparison of Two Popular JavaScript Build Tools]]></title>
            <link>https://medium.com/@cavidselimov.cs/webpack-vs-vite-a-comparison-of-two-popular-javascript-build-tools-6ca568c14bb2?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ca568c14bb2</guid>
            <category><![CDATA[js-bundlers]]></category>
            <category><![CDATA[vite-vs-webpack]]></category>
            <category><![CDATA[javascript-bundler]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[vitejs]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Wed, 03 May 2023 02:35:33 GMT</pubDate>
            <atom:updated>2023-05-03T02:35:33.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*jn4HisrvthDk6RI6KOjzdw.png" /></figure><p><strong>As web developers, we rely on build tools to automate tasks such as bundling, transpiling, and optimizing our code. Two of the most popular build tools for modern JavaScript applications are webpack and Vite. In this article, we’ll explore the main differences between these tools, provide examples of how they work, and help you decide which one to use for your next project.</strong></p><h3>What is webpack?</h3><p>Webpack is a widely used module bundler for JavaScript applications. It’s a powerful and flexible tool that can handle complex projects with many dependencies, and supports a wide range of customization options through its extensive configuration system.</p><p>Webpack works by creating a dependency graph of your application, and then bundling all of the required modules into a single file (or multiple files) that can be served to the browser. This process includes transpiling modern JavaScript features, such as ES6 modules and syntax, into code that can be executed by older browsers.</p><p>Here’s an example of a webpack configuration file that defines a basic setup for a React application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_gxEgXxKv1YRRoFV1YySQ.png" /></figure><p>This configuration file defines the entry point for our application (index.js), the output filename and directory for the bundled code, and a rule that tells webpack to use the Babel loader to transpile JavaScript files that match the .js or .jsx extensions.</p><h3>What is Vite?</h3><p>Vite is a newer build tool that was created with the goal of improving the development experience for modern JavaScript applications. It takes a different approach than webpack by leveraging native ES modules in the browser, which allows for faster and more efficient builds.</p><p>Vite works by serving your application files directly to the browser, without the need for bundling. This means that your application code can be loaded and executed as separate modules, which can significantly reduce build times and improve development workflow.</p><p>Here’s an example of a Vite configuration file that defines a basic setup for a React application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*JwckyefgCz366Gr3OUu_Rg.png" /></figure><p>This configuration file defines a plugin for Vite that adds support for React, and sets the output directory for the built code.</p><h3>Differences between webpack and Vite</h3><p>Now that we’ve seen some examples of how webpack and Vite work, let’s take a closer look at the main differences between these tools:</p><ol><li>Bundling vs. Native ES Modules Webpack relies on bundling your application code into a single file (or multiple files) that can be served to the browser. Vite, on the other hand, uses native ES modules in the browser to load and execute your code.</li><li>Build Time vs. Development Time Webpack can take longer to build your application, especially for larger projects with many dependencies. Vite, on the other hand, focuses on improving development workflow by providing faster build times and more efficient hot module replacement.</li><li>Configuration Complexity Webpack is a powerful and flexible tool, but its configuration can be complex and time-consuming. Vite aims to simplify configuration by providing sensible defaults and a plugin system that streamlines the setup process.</li><li>Compatibility Webpack has been around for many years and has a large user base, which means that it supports a wide range of use cases and integrations with other tools. Vite is a newer tool that is still gaining popularity, which means that it may not yet have the same level of support for some use cases or integrations.</li></ol><h3>Which one to use?</h3><p>So, which build tool should you choose for your next project? As with most development decisions, the answer depends on your specific needs and preferences. Here are some factors to consider when choosing between webpack and Vite:</p><ul><li><em>Project size and complexity: If you’re working on a large project with many dependencies, webpack may be a better choice due to its ability to handle complex configurations and optimizations. On the other hand, if you’re working on a smaller project or a simple prototype, Vite’s faster build times and simplified configuration may be more appealing.</em></li><li><em>Development workflow: If you value a fast and efficient development workflow with quick feedback loops, Vite’s hot module replacement and native ES module support can help you iterate more quickly. If you prefer a more controlled and configurable build process, webpack may be a better choice.</em></li><li><em>Ecosystem and integrations: If you’re already using webpack in your project, or if you need to integrate with specific plugins or tools that only work with webpack, it may be easier to stick with webpack. However, if you’re starting a new project or want to try out a newer tool with a different approach, Vite may be worth considering.</em></li></ul><p><strong>Conclusion</strong></p><p><strong>Webpack and Vite are both powerful and flexible build tools for modern JavaScript applications, each with their own strengths and weaknesses. Ultimately, the choice between these tools depends on your specific needs and preferences. If you value configurability and compatibility, and need to handle complex projects with many dependencies, webpack may be the best choice. If you value fast build times, efficient development workflow, and native ES module support, Vite may be the way to go. Regardless of which tool you choose, both webpack and Vite are great options for building modern web applications with JavaScript.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ca568c14bb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Factory Design Pattern]]></title>
            <link>https://medium.com/@cavidselimov.cs/factory-design-pattern-2cf59225b8b2?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cf59225b8b2</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[patterns]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[factory-design-pattern]]></category>
            <category><![CDATA[designpatternjs]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 12:35:14 GMT</pubDate>
            <atom:updated>2023-03-13T12:35:14.034Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ZjdvcwHlqbYDfwxFHU_JZA.png" /></figure><blockquote>There are 3 main design patterns. Creational, Structural, Behavioral. Among them, let’s talk about Factory pattern. It is of the Creational type. And it usually includes creating another object from one object. The first object plays the role of a factory. I will continue by showing the example through javascript. In the examples, I will explain using both : the new class keyword method and the previous function factory methods.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*8RlSAp5qRz34hL0vXw3ACw.png" /><figcaption>With Function Factory</figcaption></figure><p>Or syntactic sugar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*_q7BS5Z4esHPTDu10q9rXA.png" /><figcaption>class Person with class keyword</figcaption></figure><p>The code parts on top are the same….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*2tyqqtOiWc6nPPx6Jep9oA.png" /><figcaption>creating another factory function</figcaption></figure><p>and analog with class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*VYBytNPiHL3vtmCQEhnj7g.png" /></figure><p>And its time to create factory pattern function with two ways (Old School and syntactic sugar)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*vaQK9HoMMiVQjpX25EIAPA.png" /></figure><p>That is it…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cf59225b8b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revealing module pattern]]></title>
            <link>https://medium.com/@cavidselimov.cs/revealing-module-pattern-a4f62fe062bd?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4f62fe062bd</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[revealing-module-pattern]]></category>
            <category><![CDATA[iife]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[private-fields]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Sun, 05 Mar 2023 09:41:23 GMT</pubDate>
            <atom:updated>2023-03-05T09:42:47.169Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*JrE5ONJ--YT2gOg0dL-CuQ.png" /></figure><blockquote>Revealing module pattern is such a rule that let’s say you want to make some features of the object inaccessible and others accessible. This is the same as private public fields in OOP logic. Of course, it is convenient to do it with classes, but it is also possible with functions, and functions called IIFE allow us to work with this pattern. Below I will share the code parts that show the task and its solution. The codes will explain everything to you more clearly.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hkkxf4YoD4bDwjgY55dILQ.png" /><figcaption>only doSomething method gonna be accesable!!!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*gZJkOteFkEbgIUY8ua9z6Q.png" /><figcaption>Solving With IIfe</figcaption></figure><p>Now you can see that _getData only accesable only inside ..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4f62fe062bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CurrentTarget vs Target differences]]></title>
            <link>https://medium.com/@cavidselimov.cs/currenttarget-vs-target-differences-93462ab0c7d9?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/93462ab0c7d9</guid>
            <category><![CDATA[event-currenttarget]]></category>
            <category><![CDATA[target]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[currenttarget]]></category>
            <category><![CDATA[events]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 13:38:19 GMT</pubDate>
            <atom:updated>2023-03-03T13:38:19.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*LIZ1zcssgQomGYNaT61E8w.png" /></figure><p>Today I will try to show the difference between currentTarget and target with examples. Usually we can encounter such questions in interviews. Therefore, I will give a general explanation.</p><p>The html code is as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hpOpoh-Ass-gFemvQHDgOw.png" /><figcaption>html block</figcaption></figure><p>The jscode is as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tr_mftfuch6UmXPLYDsAxw.png" /></figure><p>For css i used mvp.css. The default screen is like below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*I0YqwPDtbcK1cIV_aNE-GA.png" /></figure><p>When we clikc on section tag the name of currentTarget and target will be written below accordingly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*GXy-dL13xbZZd_-Byq2_HQ.png" /></figure><p>I repeat this process in several places. This is my form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*Of5QtisJVYo8CY3K3U5HzQ.png" /></figure><p>And this is on button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*KFPeFkmOSyKuIHje3gyyBQ.png" /></figure><p>As it is clear from the pictures, whatever tag the event is attached to is the current target, but the target has changed as a result of delegation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93462ab0c7d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In this episode i will create redux from scratch and implement it on html with vanilla js.]]></title>
            <link>https://medium.com/@cavidselimov.cs/this-episode-i-will-create-redux-from-scratch-and-implement-it-on-html-with-vanilla-js-for-3e2ceac23896?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e2ceac23896</guid>
            <category><![CDATA[own-redux]]></category>
            <category><![CDATA[create-own-redux]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[how-to-create-redux]]></category>
            <category><![CDATA[redux-toolkit]]></category>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 11:09:01 GMT</pubDate>
            <atom:updated>2023-02-13T11:20:33.460Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*EnTcQ_ZwCfanS64UNlBowg.png" /></figure><p>In this episode i will create redux from scratch and implement it on html with vanilla js. For that reason i will use some screenshots. And will explain all code lines with comments</p><p>First things first. Let’s create project like below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2RaDWFoQ1ALut-uTxMO-NA.png" /></figure><p>You see that in my project there are simple html and two js files. Inside html i created one heading and two buttons. The purpose of this buttons are to increment and decrement headings inner html. <br>in redux.js file i created simple createStore function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bK6aFgi2O8pzg9tsmo6gYA.png" /></figure><p>As you can see our createStore functions accepts reducer. It has own state and list of listeners. But listeners is empty and state is undefined now. To get our state dynamically we create getState method. After that we create our dispatch function which takes action object and sets state. And after that calls every listeners and puts our state inside it. Very accurate implementation. Below dispatch function we have another method subscribe. subscribe method helps us to call it and put inside the methods which we want to call every dispatch. That is awesome. Below subscribe we have a line. For first time when we call create store it create firts state after all that we return this methods. Now lets look how to utilize this createStore method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ctVWLohT95BxdUGFGqWPxQ.png" /></figure><p>as you see we create variables and hook the elements in html. And define initialState. Then create reducer like original redux reducer implementation. Then create a store from preimported file. And how i metioned before we create the method which changes inner html of heading. In the next slide we will subscribe to this method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRe4XNOLMpFS6u5Pvtf2TQ.png" /></figure><p>in the line 42 we subscribe the update method. On event listeners we call dispatch methods. This implementation was very simple. But i hope this was very helpfull for understanding. At the end i put the screen from the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hi8whfwUeynqFqmjrkHNmg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e2ceac23896" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Download films from blob url]]></title>
            <link>https://medium.com/@cavidselimov.cs/download-films-from-blob-url-3e12ed351730?source=rss-2756c4d1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e12ed351730</guid>
            <dc:creator><![CDATA[Javid Salim]]></dc:creator>
            <pubDate>Fri, 10 Feb 2023 17:03:29 GMT</pubDate>
            <atom:updated>2023-02-10T17:03:29.626Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*IkSXk6qEy2AHWeCmihbyMQ.png" /></figure><p>Today I will show you how to download movies from blob link</p><p>we will open any link first</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkZ19XUKjzDfAv5sIjj99A.png" /></figure><p>now let’s choose the movie</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yUmvua8c_ijm96EtgpPiNw.png" /></figure><p>Scroll down…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkoGQwvpEEKdSWqwrKC8Qw.png" /></figure><p>let’s inspect the page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wRoxgstzWyeuF3Cp-h9eg.png" /></figure><p>blob url appears here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hkyownkpHqffBGUXF8AM1w.png" /></figure><p>Now click network button and in search box type m3u8 which is file extension of file we want download</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8uFLk-Sz7QLmkU8ZgBCkA.png" /></figure><p>And now when we start to watch the film, (and we have to be sure if the “all” button is clicked) on right board appears the file with the extension m3u8</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4pQKEQ-pjUCSKp0xCkownA.png" /></figure><p>Now we click on appeared file.On right panel opens header.And then we copy link</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*a1VLRc8w2WZIAHXlW8I6gA.png" /></figure><p>and we put the link on search box in chrome.And file downloads.But this file is not a film.We have to open this file with third party programs as vlc media player (when i click on film opens vlc player and starts film) if we want to download . We open vlc player</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L_N6EH3FZ2lSoukF8ZyRJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4k_U6o_gPyHl4Yb4BuPcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRf-8AyRU89J8uB5fgwALg.png" /></figure><p>at the upper photo we select the folder where we want to download</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rNJZIPkSyreB05ODQYjrqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*kO-ItOcPBMqbU-_5HvEwuw.png" /></figure><p>That is it. And after download.We can watch film!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e12ed351730" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>