<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Promise Stephen</title>
    <description>The latest articles on DEV Community by Promise Stephen (@promzzy2020).</description>
    <link>https://dev.to/promzzy2020</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%2F503327%2F653e9dce-a453-48cd-a0a0-8431881b74b2.jpg</url>
      <title>DEV Community: Promise Stephen</title>
      <link>https://dev.to/promzzy2020</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/promzzy2020"/>
    <language>en</language>
    <item>
      <title>Streamlining Development with Mock Service Worker (MSW)</title>
      <dc:creator>Promise Stephen</dc:creator>
      <pubDate>Fri, 05 Apr 2024 15:33:50 +0000</pubDate>
      <link>https://dev.to/promzzy2020/streamlining-development-with-mock-service-worker-msw-3g62</link>
      <guid>https://dev.to/promzzy2020/streamlining-development-with-mock-service-worker-msw-3g62</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Mock Service Work (MSW) is a crucial aspect of modern software development, especially in the realm of web development and testing. This article aims to provide an understanding of what MSW entails, how it works, and the benefits it offers to developers and teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Mock Service Work (MSW)?
&lt;/h2&gt;

&lt;p&gt;Mock Service Work is a technique used in software development to simulate the behavior of external dependencies, such as APIs or services, during the development and testing phases. Instead of relying on actual network requests to external services, developers can mock responses, allowing them to isolate components and test their functionality independently.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does It Work?
&lt;/h2&gt;

&lt;p&gt;Mock Service Work typically involves intercepting outgoing HTTP requests made by the application and returning predefined mock responses instead of making actual network requests. This interception can be achieved through various means, such as browser plugins, libraries, or built-in functionalities of testing frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation of Mock Service Work
&lt;/h2&gt;

&lt;p&gt;Below is an example implementation of Mock Service Work using a popular library called msw (Mock Service Worker) with React and Axios:&lt;/p&gt;

&lt;p&gt;Install msw via npm or yarn.&lt;br&gt;
&lt;code&gt;npm install msw --save-dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a src/mocks/handlers.js file to define mock request handlers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Describe the network.
import { http, HttpResponse } from 'msw';


export const handlers = [
  http.get('https://acme.com/product/:id', ({ params }) =&amp;gt; {
    return HttpResponse.json({
      id: params.id,
      title: 'Porcelain Mug',
      price: 9.99,
    })
  }),
]

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

&lt;/div&gt;



&lt;p&gt;In your test setup file or application entry point, configure MSW to start intercepting requests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/setupTests.js
import { setupServer } from 'msw/node';
import { handlers } from './mocks/handlers';

const server = setupServer(...handlers);
server.listen();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use mocked endpoints in your components as show&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/components/ProductDetails.js
import React, { useState, useEffect } from 'react';
import axios from 'axios';

const ProductDetails = () =&amp;gt; {
  const [product, setProduct] = useState(null);

  useEffect(() =&amp;gt; {
    axios.get('https://acme.com/product/:id')
      .then(response =&amp;gt; setProduct(response.data))
      .catch(error =&amp;gt; console.error('Error fetching product:', error));
  }, []);

  return (
    &amp;lt;div&amp;gt;
      {product &amp;amp;&amp;amp; (
        &amp;lt;div&amp;gt;
          &amp;lt;p&amp;gt;Name: {product.title}&amp;lt;/p&amp;gt;
          &amp;lt;p&amp;gt;Price: {product.price}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      )}
    &amp;lt;/div&amp;gt;
  );
};

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benefits of Using Mock Service Work
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Isolation&lt;/strong&gt;: MSW allows developers to isolate components for testing by removing dependencies on external services, leading to more focused and efficient testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed&lt;/strong&gt;: Mock responses are generated locally, eliminating the latency associated with real network requests, thereby speeding up the development and testing process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Predictability&lt;/strong&gt;: With MSW, developers can control the responses returned by mocked endpoints, ensuring predictable behavior during testing scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost-Efficiency&lt;/strong&gt;: By reducing reliance on external services during development and testing, MSW can help lower costs associated with API usage or testing environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improved Collaboration&lt;/strong&gt;: Mocked endpoints provide a consistent interface for development and testing across different team members, enhancing collaboration and communication within the team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Mock Service Work is a valuable technique in modern software development, offering developers the ability to simulate external dependencies for testing purposes. By understanding its implementation, functionality, and benefits, developers can streamline their development process and deliver more robust and reliable software products.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript Function Currying</title>
      <dc:creator>Promise Stephen</dc:creator>
      <pubDate>Sun, 07 Jan 2024 16:31:44 +0000</pubDate>
      <link>https://dev.to/promzzy2020/javascript-function-currying-jgh</link>
      <guid>https://dev.to/promzzy2020/javascript-function-currying-jgh</guid>
      <description>&lt;h2&gt;
  
  
  What is Currying?
&lt;/h2&gt;

&lt;p&gt;Currying is a technique in functional programming where a function that takes multiple arguments is transformed into a series of functions, each taking a single argument.  The result of each function is another function that expects the next argument in the sequence. This process continues until all arguments are provided, and the final function produces the desired result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v5K2mpcn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kwwwrqu380r41a68mjua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v5K2mpcn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kwwwrqu380r41a68mjua.png" alt="Image description" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Currying?
&lt;/h2&gt;

&lt;p&gt;Currying allows for more flexible function composition. It enables the creation of specialized functions by partially applying arguments. This can be particularly beneficial in scenarios where you want to reuse parts of a function with different inputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example of Currying in JavaScript
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Let's look at a simple example to illustrate currying:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Non-curried function
function sum(x, y, z) {
  return x + y + z;
}
const sumResult = sum(2, 3, 4);

console.log(sumResult); // Outputs 9

//Curried function
function curriedSum(x) {
  return function (y) {
    return function (z) {
      return x + y + z;
    };
  };
}

const curriedResult = curriedSum(2)(3)(4);

console.log(curriedResult); // Outputs 9

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Currying is a powerful technique that enhances the modularity of functions in JavaScript. Understanding and applying currying can lead to more modular and reusable code.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>LEARNING TYPESCRIPT AS A SOFTWARE DEVELOPER PUTS YOU IN HIGH DEMAND</title>
      <dc:creator>Promise Stephen</dc:creator>
      <pubDate>Sat, 25 Jun 2022 20:47:28 +0000</pubDate>
      <link>https://dev.to/promzzy2020/learning-typescript-as-a-software-developer-puts-you-in-high-demand-3gcl</link>
      <guid>https://dev.to/promzzy2020/learning-typescript-as-a-software-developer-puts-you-in-high-demand-3gcl</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;u&gt;What is TypeScript?&lt;/u&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;TypeScript is a programming language first developed by Microsoft in 2012. It is an open-source language developed as a superset of JavaScript. Its main ambition is to improve the productivity of developing complex applications. Any code valid in JavaScript is also valuable for TypeScript. However, the language introduces optional features like typing or object-oriented programming. TypeScript has been increasing in its popularity for the last couple of years. About 60% of JS programmers already use TypeScript, and 22% wish to try.&lt;/p&gt;

&lt;h2&gt;
  
  
  **Types of TypeScript
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;For programs to be useful, we need to be able to work with some of the simplest units of data (numbers, strings, structures, boolean values, etc.) TypeScript supports the same types as you would expect in JavaScript, with an extra enumeration type thrown in to help things along.&lt;br&gt;
**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Boolean
**
The BOOLEAN data type stores TRUE or FALSE data values.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isDone: boolean = false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Number
**
Just like JavaScript, TypeScript supports a number of data types. All numbers are stored as floating-point numbers. These numbers can be Decimal (base 10), Hexadecimal (base 16), or Octal (base 8).
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let decimal: number = 6;
let hex: number = 0xf00d;
let binary: number = 0b1010;
let octal: number = 0o744;
let big: bigint = 100n;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;String
**
A sequence of character values is represented by an object called a string in TypeScript which is used to store text data and is a primitive data type consisting of several helper methods and these string values are enclosed in either single quotation marks (') or double quotation marks (").
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let color: string = "blue";
color = 'red';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Array
**
TypeScript, like JavaScript, allows you to work with arrays of values. Array types can be written in one of two ways. In the first, you use the type of the elements followed by [] to denote an array of that element type:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let list: number[] = [1, 2, 3];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The second way uses a generic array type, Array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let list: Array&amp;lt;number&amp;gt; = [1, 2, 3];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object
**
The TypeScript object type represents all values that are not in primitive types i.e. anything that is not &lt;em&gt;number&lt;/em&gt;, &lt;em&gt;string&lt;/em&gt;, &lt;em&gt;boolean&lt;/em&gt;, &lt;em&gt;bigint&lt;/em&gt;, &lt;em&gt;symbol&lt;/em&gt;, &lt;em&gt;null&lt;/em&gt;, or &lt;em&gt;undefined&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any &amp;amp; Unknown
**
While any as a type can cover, well, anything that you wish, unknown is its type-safe counterpart. Whenever you want to escape the type system, and enables you to assign any JavaScript variable to it. It is frequently used to model incoming variables (from third-party APIs, for example) that have not yet been checked and whose type is unknown. The unknown is a lot like any, but it won’t let you perform any operations on the variable before it is explicitly type-checked.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Void
**&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Void is used when there is no value returned, for example, as the return type of functions that return nothing.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Null and Undefined
**
In TypeScript, both undefined and null actually have their types named undefined and null respectively. Much like void, they’re not extremely useful on their own:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let u: undefined = undefined;
let n: null = null;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Never
**
Never is the return type for something that should never occur, like a function that will throw an exception.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Features and Components
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
TypeScript was initially supported only in Microsoft’s Visual Studio code editor because TypeScript is maintained by Microsoft. But as TypeScript grew legs, more code editors and IDEs began started supporting it either natively or with plugins.&lt;/p&gt;

&lt;p&gt;TypeScript is essentially a JS linter. Or, JS with documentation that the compiler can understand. Therefore, in contrast to other languages like CoffeeScript (which adds syntactic sugar) or PureScript (which does not look like JavaScript at all), you do not need to learn a lot to start writing TypeScript code.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>15 Tech skills companies are looking for in freelance software developers</title>
      <dc:creator>Promise Stephen</dc:creator>
      <pubDate>Tue, 24 Nov 2020 14:00:12 +0000</pubDate>
      <link>https://dev.to/promzzy2020/15-tech-skills-companies-are-looking-for-in-freelance-software-developers-2b7o</link>
      <guid>https://dev.to/promzzy2020/15-tech-skills-companies-are-looking-for-in-freelance-software-developers-2b7o</guid>
      <description>&lt;p&gt;IT companies around the world are hiring contract and freelance tech professionals to fill immediate demand. There is a huge demand for software developers and engineers that can work in a freelance capacity. The freelancer listing and aggregator platform, Upwork has recently published a list of most in-demand tech skills for freelancers. The platform has also published a survey citing the skills that IT managers look for in freelancers.&lt;/p&gt;

&lt;p&gt;Here are the most in-demand tech skills for freelancers:&lt;/p&gt;

&lt;p&gt;JavaScript CSS HTML Website Development PHP API Development WordPress HTML5 Web Design Python Web Application API Integration jQuery MySQL React&lt;br&gt;
It is no surprise that the most in-demand programming languages among freelancers are also the most popular languages for full-time positions. A survey report by Burning Glass has also listed the same tech skills as the highest in-demand skills for full-time tech positions.&lt;/p&gt;

&lt;p&gt;Popular programming language skills for freelancers:&lt;/p&gt;

&lt;p&gt;SQL Java Python JavaScript Microsoft C# C++ Ruby&lt;br&gt;
The employers are looking for full-stack programmers that are capable of working in multiple technologies. The freelance developers that have the demand in today's market are expected to have extensive knowledge of HTML, CSS, JavaScript, WordPress and more.&lt;/p&gt;

&lt;p&gt;For smaller companies, it makes sense to hire resources having multiple skillsets. Amid the Covid-19 pandemic, many businesses rushed to take their businesses online with the help of e-commerce platforms, which has raised the demand and popularity for developers with web and e-commerce skills. Burning Glass report predicts that the need for web developers will grow by 14.9% over the next ten years.&lt;/p&gt;

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