<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Emmanuel Umeh</title>
    <description>The latest articles on Forem by Emmanuel Umeh (@emmaumeh).</description>
    <link>https://forem.com/emmaumeh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1039414%2Fe78ac2f9-fd5d-44f2-8226-19bf3f29b3b3.jpeg</url>
      <title>Forem: Emmanuel Umeh</title>
      <link>https://forem.com/emmaumeh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/emmaumeh"/>
    <language>en</language>
    <item>
      <title>Understanding Stack Memory and Heap Space in Java.</title>
      <dc:creator>Emmanuel Umeh</dc:creator>
      <pubDate>Mon, 11 Mar 2024 09:59:58 +0000</pubDate>
      <link>https://forem.com/emmaumeh/understanding-stack-memory-and-heap-space-in-java-fbn</link>
      <guid>https://forem.com/emmaumeh/understanding-stack-memory-and-heap-space-in-java-fbn</guid>
      <description>&lt;p&gt;In the Java ecosystem, The JVM which stands for Java Virtual Machine is what enables java codes machine readable for interpretation. Now when it comes to the memory management, the JVM has two main memory storage, which are the stack and heap.&lt;br&gt;
The stack and heap are use extensively in data structures and algorithms for managing memory allocation.&lt;br&gt;
In this tutorial guide, we'll explain what the stack and heap is all about, differences and code examples to illustrate them.&lt;/p&gt;

&lt;p&gt;What is Java Stack Memory?&lt;br&gt;
Generally, stack represents LIFO(Last In First Out) order which means the last  item inserted or added is the first item to be removed when accessing the stack. whenever a method is invoked, it is directly pushed into the stack and a new block of memory is allocated to the stack memory. This new block will store values of the variables used in the method. In Java, stacks memory are used for static memory allocation. Java stack stores method calls and local variables in the memory. Stack memory size is very small compared to the Heap memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Java Heap Space?&lt;/strong&gt;&lt;br&gt;
Java Heap space are large, open space memory used in java runtime. whenever we create or reference an object, it is usually created in the heap. it memory stores instance variables, objects and JRE classes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Differences Between Stack Memory and Heap Space in Java&lt;/strong&gt;&lt;br&gt;
The Stack and Heap has different similarities both in size and efficiency. In this article we'll outline the core differences between the stack and Heap space in java.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;In the memory management, Stack follows the LIFO order while the Heap does not follows any order, as it is a dynamic data structure and it's space complexity tends to be dynamic, allowing for flexible allocation and deallocation of memory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Stack is used for a single thread of execution while Heap is dynamic and robust is used by the entire application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whenever an object is invoked or created, it's stored automatically into the Heap memory, while the stack memory contains the local variables and reference to the new object created.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;How do Stack and Heap Works?&lt;/strong&gt;&lt;br&gt;
Here, we use a code snippet to explain how the stack and heap works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Calculator {
    int num;
    public int add(int n1, int n2) {
        int r = n1 + n2;
        return r;
        // System.out.println("in add");
    }
}

public class Stack {
    public static void main(String[] args) {
        int data = 10;


        int n1 = 4;
        int n2 = 3;

        Calculator obj = new Calculator();
        Calculator obj1 = new Calculator();
        int result = obj.add(n1, n2);

        System.out.println(result);
        System.out.println(obj.num);
        System.out.println(obj1.num);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The diagram below explains how the stack and heap memory are related with the above program&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faaqcqhjmnnmys0ydwkx1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faaqcqhjmnnmys0ydwkx1.png" alt="Image description" width="800" height="549"&gt;&lt;/a&gt;&lt;br&gt;
Now let's briefly explain each process in the diagram:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In the stack memory we have the main and the add method. which the main contains variables with their keys and values:  data which contains the unused variable declared, obj and obj1 which are two instances of the Calculator class created in the stack and the result is represent the output of the given program. while the add method contains the n1, n2 respectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now the obj, obj1 are referencing to the object in the heap. where the exact memory for the Calculator objects is allocated in the heap space. All these referencing(IDs or addresses) employs or allows a way to access these objects properties and method in a more accessible way.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the heap memory side, it contains a &lt;code&gt;num = 10&lt;/code&gt;, if you look at that num = 10 in our code that has int num;, the &lt;code&gt;int num&lt;/code&gt;; is an instance variable. Here heap stores the instance variable in the heap memory. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the heap memory, It also has an add() method which will store the executable code for add() function. When &lt;code&gt;obj.add(n1, n2)&lt;/code&gt; is called in the main method, it accesses this &lt;code&gt;add()&lt;/code&gt; method in the heap memory&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Stack and Heap memory are great memory allocation when dealing with algorithm problem, understanding how they work interchangeably will help foster the usage between them. What else do you know about stack and Heap let's us know in the comment section.&lt;/p&gt;

</description>
      <category>java</category>
      <category>stack</category>
      <category>heap</category>
    </item>
    <item>
      <title>Automating ETL Processes with Node.js</title>
      <dc:creator>Emmanuel Umeh</dc:creator>
      <pubDate>Mon, 15 Jan 2024 19:24:58 +0000</pubDate>
      <link>https://forem.com/emmaumeh/automating-etl-processes-with-nodejs-c06</link>
      <guid>https://forem.com/emmaumeh/automating-etl-processes-with-nodejs-c06</guid>
      <description>&lt;p&gt;The Extract, transfer and load(ETL) processes is the process of extracting, transforming and loading data from multiple source into a centralized container known as data warehouse. This data warehouse is what serve as the repository where all the exchanged and integrated data are been stored and kept for analysis.&lt;/p&gt;

&lt;p&gt;By automating these processes, Node.js, a scalable JavaScript runtime language, made it easier for developers to possibly automate those processes with sequential lines of code, thereby creating efficient data pipelines that streamline data integration and analysis.&lt;/p&gt;

&lt;p&gt;In this tutorial guide, we'll explore how to efficiently automate ETL processes with Node.js for efficient data pipelines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To efficiently automate ETL processes with Node.js for efficient data pipelines, the following prerequisite is necessary:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nodejs&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure Node.js is installed on your local machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;MongoDB&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make sure &lt;a href="https://www.mongodb.com/try/download/community" rel="noopener noreferrer"&gt;MongoDB&lt;/a&gt; is installed locally into your machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Csv-parser&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install the csv-parser module, A tool and library for processing CSV data during ETL process&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Initialize Node.js Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open a terminal, create a directory for the project and also Initialize the Node.js project by running the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init --y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Installed required dependencies:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install csv-parser mongodb dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Create a data.csv file inside the root directory and add the following text below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME,CAREER
REV ONUCHE, SOFTWARE DEVELOPER,
Damilola Daramola, SOFTWARE DEVELOPER,
David Herbert,TECHNICAL WRITER,
WIsdom Nwokocha,TECHNICAL WRITER

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

&lt;/div&gt;

&lt;p&gt;Now, let's break down the ETL processes into phases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extract Phase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the extraction phase, this is the initial phase where raw data is automatically extracted and processed from the data.csv file using the CSV library for easier extraction.&lt;/p&gt;

&lt;p&gt;Below are the code snippets with breakdowns to help you understand the full concept of this code:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup File System Module(FS):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Initiates the file system module, by importing the fs module. The fs which is known as the file system is a built-in Node.js module that provides file-related operations.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require('fs');

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

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;MongoDB Setup:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Import the MongoClient class from the MongoDB Node.js driver.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { MongoClient } = require('mongodb');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;CSV Parser Setup:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Import the csv-parser module using the code snippet below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const csvParser = require('csv-parser');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Import the CSV Data Path:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ensure you created a data.csv file in your project.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const csvDataPath = 'data.csv';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Setup Environment Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This automatically configure environment variables using the dotenv module.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require('dotenv').config();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Create an extractData function:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a function extractData() that will extract data from the data.csv file&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const extractData = (csvDataPath) =&amp;gt; {
  return new Promise((resolve, reject) =&amp;gt; {
    const data = [];

    fs.createReadStream(csvDataPath)
      .pipe(csvParser())
      .on('data', (item) =&amp;gt; {
        data.push(item);

      })
      .on('end', () =&amp;gt; {
        resolve(data);
      })

      .on('error', (error) =&amp;gt; {
        reject(error);
      });
  });
};

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

&lt;/div&gt;

&lt;p&gt;Here is what the code explains below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const extractData = (csvDataPath) =&amp;gt; { ... }&lt;/code&gt;: This declares a function named &lt;code&gt;extractData&lt;/code&gt; using an arrow function. It takes a parameter, &lt;code&gt;csvDataPath&lt;/code&gt;, which is the path to the CSV file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;return new Promise((resolve, reject) =&amp;gt; { ... })&lt;/code&gt;: These returns a new Promise function. it handles asynchronous operations.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const data = []&lt;/code&gt;: This create an empty array named data.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fs.createReadStream(csvDataPath)&lt;/code&gt;: The &lt;code&gt;createReadStream&lt;/code&gt; function reads data from the &lt;code&gt;csvDataPath&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;.pipe(csvParser())&lt;/code&gt;: The pipe method primarily connects the readable stream of the &lt;code&gt;csvDataPath&lt;/code&gt; and pass out the output to the &lt;code&gt;csv-parser&lt;/code&gt; module for further processing.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.on('data', (item) =&amp;gt; { ... })&lt;/code&gt;: This event handles each row of data parsed from the CSV file. The &lt;code&gt;data.push(item)&lt;/code&gt; function appends the item to an array called data.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.on('end', () =&amp;gt; { ... })&lt;/code&gt;: This event handler is triggered when the end of the CSV file is reached. It resolves the promise with the populated data array.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.on('error', (error) =&amp;gt; { ... })&lt;/code&gt;: This event handler , handles an error that might occur during the file reading or parsing process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transform Phase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the transform phase, this is where the extracted data is refined and structured.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Transform Phase
const transformData = (csvData) =&amp;gt; {
  return csvData.map((items) =&amp;gt; ({
    name: items.NAME.trim(), // Trim whitespace from the Name valu
    career: items.CAREER.trim(),  // Trim whitespace from the career value
  }));
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here is what the code explains below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const transformData = (csvData) =&amp;gt; {&lt;/code&gt; : This declares a function &lt;code&gt;transformData&lt;/code&gt; that takes a parameter &lt;code&gt;csvData&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;return csvData.map((items) =&amp;gt; ({})&lt;/code&gt;: The map function iterates each item in the all &lt;code&gt;csvData&lt;/code&gt; array.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;name: items.NAME.trim()&lt;/code&gt;: This extracts the Name property from the &lt;code&gt;data.csv&lt;/code&gt; file in each item, together with &lt;code&gt;.trim()&lt;/code&gt; that trims out any whitespace.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;career: item.CAREER.trim()&lt;/code&gt;: This also extracts the Career property from the data.csv file each item.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Load Phase:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the load phase, this is where the extracted data is loaded into the mongoDB database.&lt;/p&gt;

&lt;p&gt;Add a .env file:&lt;/p&gt;

&lt;p&gt;Create a .env file in the root directory and add your mongoDB url.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MONGODB_URL='YOUR_MONGODB_URL'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Set Up the MongoDB connection URL from environment variables:&lt;/p&gt;

&lt;p&gt;Locate the MONGODB_URL using the &lt;code&gt;process.env.YOUR_MONGODB_URL_NAME&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const dbUrl = process.env.MONGODB_URL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Set the MongoDB connection string:&lt;/p&gt;

&lt;p&gt;This code uses template literals to call dbUrl instead of rewriting process.env.MONGODB_URL again.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const connectionString = `${dbUrl}`;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Set the database name:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const databaseName = process.env.MONGODB_DATABASE || 'etldb';

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

&lt;/div&gt;

&lt;p&gt;This code sets the &lt;code&gt;databaseName&lt;/code&gt; variable by checking if the &lt;code&gt;MONGODB_DATABASE&lt;/code&gt; environment variable is defined. If defined, it uses that value; otherwise, it set defaults to &lt;code&gt;etldb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Set the collection name:&lt;/p&gt;

&lt;p&gt;This creates a collection name users in the mongodb database.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const collectionName = 'users';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Create a LoadData Function:&lt;/p&gt;

&lt;p&gt;Create an async &lt;code&gt;loadData()&lt;/code&gt; function with the following parameters: &lt;code&gt;transformedData, databaseName, collectionName, connectionString&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const loadData = async (transformedData, databaseName, collectionName, connectionString) =&amp;gt; {
  const client = new MongoClient(connectionString, {
    useNewUrlParser: true,
    useUnifiedTopology: true,
  });

  try {

    await client.connect();
    console.log('Connected to MongoDB successfully.');

    const db = client.db(databaseName);
    const collection = db.collection(collectionName);

    const response = await collection.insertMany(transformedData);
    // console.log("RESPONSE", response);
    console.log(`${response.insertedCount} CSV Data Successfully loaded to MongoDB.`);

  } catch (error) {
    console.error('Error Connecting MongoDB', error);
  }

  await client.close();
};

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

&lt;/div&gt;

&lt;p&gt;Call the extractData() to Initiates the ETL process:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;extractData(csvDataPath)
  .then((rawData) =&amp;gt; {
    const transformedData = transformData(rawData);
    return loadDataToMongoDB(transformedData, databaseName, collectionName, connectionString);
  })
  .catch((error) =&amp;gt; {
    console.error('Failed to extract or load data into MongoDB:', error);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This code initiates the ETL process by extracting it, transforming it and also loading it to the MongoDB database:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Entire Code:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require('fs');
const csvParser = require('csv-parser');
const { MongoClient } = require('mongodb');
const csvDataPath = 'data.csv'; 

require('dotenv').config();

// Extract Phase

const extractData = (csvDataPath) =&amp;gt; {
  return new Promise((resolve, reject) =&amp;gt; {
    const data = [];

    fs.createReadStream(csvDataPath)
      .pipe(csvParser())
      .on('data', (item) =&amp;gt; {
        data.push(item);

      })
      .on('end', () =&amp;gt; {
        resolve(data);
      })

      .on('error', (error) =&amp;gt; {
        reject(error);
      });
  });
};


// Transform Phase
const transformData = (csvData) =&amp;gt; {
  return csvData.map((items) =&amp;gt; ({
    name: items.NAME.trim(), // Trim whitespace from the Name value
    career: items.CAREER.trim(),  // Trim whitespace from the career value
  }));
};


const dbUrl = process.env.MONGODB_URL;

const connectionString = `${dbUrl}`;
const databaseName = process.env.MONGODB_DATABASE || 'etldb'; 
const collectionName = 'users'; 

// Load Phase
const loadData = async (transformedData, databaseName, collectionName, connectionString) =&amp;gt; {
  const client = new MongoClient(connectionString, {
    useNewUrlParser: true,
    useUnifiedTopology: true,
  });

  try {

    await client.connect();
    console.log('Connected to MongoDB successfully.');

    const db = client.db(databaseName);
    const collection = db.collection(collectionName);

    const response = await collection.insertMany(transformedData);
    // console.log("RESPONSE", response);
    console.log(`${response.insertedCount} CSV Data Successfully loaded to MongoDB.`);

  } catch (error) {
    console.error('Error Connecting MongoDB', error);
  }

  await client.close();
};

extractData(csvDataPath)
  .then((rawData) =&amp;gt; {
    const transformedData = transformData(rawData);
    return loadData(transformedData, databaseName, collectionName, connectionString);
  })
  .catch((error) =&amp;gt; {
    console.error('Failed to extract or load data into MongoDB:', error);
  });

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

&lt;/div&gt;

&lt;p&gt;Run the Server:&lt;/p&gt;

&lt;p&gt;Navigate to the terminal and start the server using this command: Make sure you have &lt;a href="https://www.npmjs.com/package//nodemon" rel="noopener noreferrer"&gt;nodemon&lt;/a&gt; installed in your local machine.&lt;/p&gt;

&lt;p&gt;nodemon etl.js&lt;/p&gt;

&lt;p&gt;Your server is now running locally..&lt;/p&gt;

&lt;p&gt;Response:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1iuk3tt140yjtai6kzsl.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1iuk3tt140yjtai6kzsl.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it gives a response with the amount of data's added into the MongoDB database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check your MongoDB:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check your mongoDB to automatically see the data loaded successfully to the MongoDB.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1qcpdm5i9uxmw87hwv7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1qcpdm5i9uxmw87hwv7.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ETL process has been a building block for companies and enterprise, and it is the best way for companies to transform those data into more readable streams or format.&lt;/p&gt;

&lt;p&gt;Furthermore, it general use case is mostly in the data warehousing- where data from various sources are been combined into a database for business analysis and customers insights.&lt;/p&gt;

&lt;p&gt;As we have come to the end of this tutorial what other pattern do you use to automate ETL processes in Nodejs? Let's us know in the comment section.&lt;/p&gt;

</description>
      <category>node</category>
      <category>automation</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding Stack and Queues in JavaScript</title>
      <dc:creator>Emmanuel Umeh</dc:creator>
      <pubDate>Tue, 21 Nov 2023 08:56:46 +0000</pubDate>
      <link>https://forem.com/emmaumeh/understanding-stack-and-queues-in-javascript-2bda</link>
      <guid>https://forem.com/emmaumeh/understanding-stack-and-queues-in-javascript-2bda</guid>
      <description>&lt;p&gt;Stacks and Queues are commonly used data structures for extensive computer science and software development which depict a clear horizon for efficient data management, algorithm design, and task scheduling.&lt;/p&gt;

&lt;p&gt;In this article, we will learn more about the principles and use cases used in the stack and queues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Stack?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A stack is a data structure where the most recently added element can be accessed and removed. Think of stacks of nested coffee cups. You'll notice to access or remove the last coffee cup, you need to remove others from the top. This is where the principle of LIFO( Last In, First out) comes in. The LIFO principle dictates that the last element added to a stack would be the first to be removed when accessing the stacks. Its time complexity is denoted by a constant O(1). This illustration depicts a stack of cups.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0tt72eawdvru63w59zq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0tt72eawdvru63w59zq.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stacks are extensively used in memory management. For instance, in the local storage of application data, stacks efficiently store and manage data. Additionally, it is also used for undo features in software application, the undo features of an application often relies on stacks to track and update user actions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below are the methods that occur in the operations in stacks.&lt;/p&gt;

&lt;p&gt;Push:&lt;/p&gt;

&lt;p&gt;The push operation adds an element to the top of the stack.&lt;/p&gt;

&lt;p&gt;Pop:&lt;/p&gt;

&lt;p&gt;The pop operation removes and returns the element from the top of the stack.&lt;/p&gt;

&lt;p&gt;Peek (or Top):&lt;/p&gt;

&lt;p&gt;The peek operation returns the element at the top of the stack without removing or modifying it.&lt;/p&gt;

&lt;p&gt;isEmpty:&lt;/p&gt;

&lt;p&gt;The isEmpty operation checks whether the stack is empty. It returns true if the stack is empty and false otherwise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concept&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here, we'll build a shelve that contains different types of coffee cups.&lt;/p&gt;

&lt;p&gt;Function&lt;/p&gt;

&lt;p&gt;Let's define a function of Stack and also initialize &lt;code&gt;this.stack = []&lt;/code&gt; as an empty array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Stack() {
    this.stack = [];
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Push&lt;/p&gt;

&lt;p&gt;Define a &lt;code&gt;this.push&lt;/code&gt; function to initialize and push items into the stack.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; // Function to push a value onto the stack
    this.push = function(coffeeCup) {
      this.stack.push(coffeeCup);
    };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pop&lt;/p&gt;

&lt;p&gt;Define a &lt;code&gt;this.pop&lt;/code&gt; function to initialize and push items into the stack.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; // Function to pop a value onto the stack
    this.pop = function() {
      this.stack.push();
    };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Peek&lt;/p&gt;

&lt;p&gt;Define a &lt;code&gt;this.peek&lt;/code&gt; function to retrieve the top item without removing it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      this.peek = function() {
      return this.stack[this.stack.length - 1];
    };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;IsEmpty&lt;/p&gt;

&lt;p&gt;Define a &lt;code&gt;this.isEmpty&lt;/code&gt; function to check if the stack is empty.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.isEmpty = function() {
      return this.stack.length === 0;
    };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Place all the code together&lt;/p&gt;

&lt;p&gt;Put all the code we defined together to see what the whole flow looks like.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function CoffeeStack() {
    this.stack = [];

    // Function to push a value onto the stack
    this.push = function(coffeeCup) {
      this.stack.push(coffeeCup);
    };

 // Function to pop a value onto the stack
    this.pop = function() {
      this.stack.push();
    };

 // Function to pop a value onto the stack
       this.peek = function() {
      return this.stack[this.stack.length - 1];
    };

// Function to check if a stack is empty
this.isEmpty = function() {
      return this.stack.length === 0;
    };

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

&lt;/div&gt;



&lt;p&gt;Let's test the Stack function.&lt;/p&gt;

&lt;p&gt;Copy this code and place it outside the CoffeStack function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let coffeCups = new CoffeeStack()
 // Pushing coffee cups onto the stack
  coffeeCups.push("Standard mug ");
  coffeeCups.push("Flat white cup");
  coffeeCups.push("Cappuccino Cup");

  // Peeking at the top coffee cup
  console.log("Top Coffee Cup:", coffeeCups.peek()); // Output: Top Coffee Cup: Cappuccino Cup

  // Popping a coffee cup from the stack
  let removedCup = coffeeCups.pop();
  console.log("Removed Coffee Cup:", removedCup); // Output: Removed Coffee Cup: Cappuccino Cup

  // Checking if the stack is empty
  console.log("Is the stack empty?", coffeeCups.isEmpty()); // Output: Is the stack empty? false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Queues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Queues are data structures that allow the First In, First Out (FIFO) principle. The FIFO principle dictates that the element that is added first is the one to be removed first. Queues share similar methods with Stack but the main distinction lies in the order or pattern of removal. Stack uses the Last In, First Out (LIFO) principle while queues make use of the First In, First Out (FIFO) principle to manage elements in a specific data structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzapahfp42tgxa2ajdam2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzapahfp42tgxa2ajdam2.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Queues are generally used in shared printers. For instance, multiple users may send print jobs to a shared printer and during the whole process, the printer prints orderly as every user sends theirs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below are the queue methods used in everyday scenarios.&lt;/p&gt;

&lt;p&gt;enqueue:&lt;/p&gt;

&lt;p&gt;Adding or inserting elements to the top of the queue.&lt;/p&gt;

&lt;p&gt;dequeue:&lt;/p&gt;

&lt;p&gt;Removing elements from the top of the queue.&lt;/p&gt;

&lt;p&gt;Peek (or Top):&lt;/p&gt;

&lt;p&gt;The peek operation returns the element at the top of the queue.&lt;/p&gt;

&lt;p&gt;isEmpty:&lt;/p&gt;

&lt;p&gt;The isEmpty operation checks whether the queue is empty. It returns true if the queue is empty and false otherwise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concept&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the queue, we'll build a VehicleQueue that ordinates the FIFO principle.&lt;/p&gt;

&lt;p&gt;Function&lt;/p&gt;

&lt;p&gt;Let's define a function of VehicleQueue and also initialize &lt;code&gt;queue = []&lt;/code&gt; as an empty array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function VehicleQueue() {
    const queue = [];

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

&lt;/div&gt;



&lt;p&gt;Enqueue&lt;/p&gt;

&lt;p&gt;Define an enqueue function to add elements using the &lt;code&gt;queue.unshift(element)&lt;/code&gt; unshift method which adds at the top of the queue.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   // Function to push a value onto the stack
   function enqueue(element) {
      queue.unshift(element);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dequeue&lt;/p&gt;

&lt;p&gt;Define a dequeue() function to remove elements using the &lt;code&gt;queue.pop()&lt;/code&gt; pop method which removes elements at the top queue.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // Function to push a value onto the stack
     function dequeue() {
      queue.pop();
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Peek&lt;/p&gt;

&lt;p&gt;Define a peek function to retrieve elements from the front of the queue without removing the element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  // Function to peek a value into the queue
    function peek() {
      return queue[queue.length - 1];
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;IsEmpty&lt;/p&gt;

&lt;p&gt;Define a isEmpty() that checks if the queue is empty.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   function isEmpty() {
      return queue.length === 0;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Place all the code together&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function VehicleQueue() {
  const queue = [];

  function enqueue(element) {
    queue.unshift(element);
  }

  function dequeue() {
    queue.pop();
  }

  function peek() {
    return queue[queue.length - 1];
  }

  function isEmpty() {
    return queue.length === 0;
  }

  return { enqueue, dequeue, peek, isEmpty };
}


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

&lt;/div&gt;



&lt;p&gt;Let's test the Queue function.&lt;/p&gt;

&lt;p&gt;Copy this code and place it outside the Queue function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const myQueue = VehicleQueue();
myQueue.enqueue("volvo");
myQueue.enqueue("volvo");

console.log("Peek:", myQueue.peek()); // Output: car1
myQueue.dequeue();
console.log("Peek:", myQueue.peek()); // Output: car2
console.log("Is Empty:", myQueue.isEmpty()); // Output: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the context of using stacks and queues in our article, I hope it helps you understand the use cases and principle underlying the breakdown of some certain processes. Moreover, how can you approach explaining stacks and queues, and are there any other use cases you would consider? Let us know in the comment section.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>datastructures</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How To Create A Custom Hooks In React.</title>
      <dc:creator>Emmanuel Umeh</dc:creator>
      <pubDate>Wed, 08 Mar 2023 22:52:51 +0000</pubDate>
      <link>https://forem.com/emmaumeh/how-to-create-a-custom-hooks-in-react-4gek</link>
      <guid>https://forem.com/emmaumeh/how-to-create-a-custom-hooks-in-react-4gek</guid>
      <description>&lt;p&gt;Custom hooks are reusable functions used for stateful logic. A custom Hook is a JavaScript function whose function starts with ”use”.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will learn how to "how to create a customhooks in react"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisite&lt;/strong&gt;&lt;br&gt;
Before we begin, these are technologies you should be familiar with and have installed on your local machine to follow up these guides:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Nodejs v18+&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React Knowledge&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this tutorial, we will build a simple e-commerce store that fetches data from FakeStoreAPI&lt;/p&gt;

&lt;p&gt;Let's start by running this in our terminal.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open your terminal and run&lt;br&gt;
npx create-react-app reactapp&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to the folder&lt;br&gt;
cd reactapp&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run&lt;br&gt;
npm start&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now our app is running locally, let's get started by:&lt;/p&gt;

&lt;p&gt;Creating a customhooks folder&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtxcmym71fcwnwqir6yv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtxcmym71fcwnwqir6yv.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside the customhooks folder create a Usefetch.js file and input this code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useState, useEffect } from "react";

 const Usefetch = (url) =&amp;gt; {
   const [images, setData] = useState([]);

   useEffect(() =&amp;gt; {
     fetch(url)

       .then((res) =&amp;gt; res.json())
       .then((images) =&amp;gt; setData(images));
   }, [url]);

   return [images];
 };

 export default Usefetch;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now create a imageHolder.js file and input this code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; import React from "react";

 const imageHolder = () =&amp;gt; {

   return (
     &amp;lt;&amp;gt;
       {
         images.map((item) =&amp;gt; {
           return &amp;lt;p key= {item.id}&amp;gt;
              &amp;lt;img src={item.image}/&amp;gt;
             &amp;lt;h4&amp;gt;{item.title}&amp;lt;/h4&amp;gt;
             &amp;lt;h1&amp;gt;{item.price}&amp;lt;/h1&amp;gt;
             &amp;lt;/p&amp;gt;
         })}
     &amp;lt;/&amp;gt;
   );

 };

 export default imageHolder;

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

&lt;/div&gt;



&lt;p&gt;Now let's import our useFetch custom hooks into our ImageHolder.js file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; import React from "react";
 import Usefetch from "../customhooks/Usefetch";

 const imageHolder = () =&amp;gt; {

   // Fetching images from fakestoreApi
   const [images] = Usefetch("https://fakestoreapi.com/products");

   return (
     &amp;lt;&amp;gt;
       {
         images.map((item) =&amp;gt; {
           return &amp;lt;p key= {item.id}&amp;gt;
             &amp;lt;img src={item.image}/&amp;gt;
             &amp;lt;h4&amp;gt;{item.title}&amp;lt;/h4&amp;gt;
             &amp;lt;h1&amp;gt;{item.price}&amp;lt;/h1&amp;gt;
             &amp;lt;/p&amp;gt;
         })}
     &amp;lt;/&amp;gt;
   );

 };

 export default imageHolder;

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

&lt;/div&gt;



&lt;p&gt;Now let's import the ImageHolder into our App.js file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; import React from "react";
 import ImageHolder from "./ImageHolder";

 function App() {

   return (
     &amp;lt;div className=""&amp;gt;
       &amp;lt;ImageHolder /&amp;gt;
       &amp;lt;/div&amp;gt;

           )

   }
 export default App;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Custom hooks are reusable functions that aid code reusability. I can say this is the best hack ever, react developers should know when creating a large or small project.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
