<?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: Rajan lagah</title>
    <description>The latest articles on DEV Community by Rajan lagah (@rajanlagah).</description>
    <link>https://dev.to/rajanlagah</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%2F866221%2F62256ed8-f327-497d-ba69-790e2272c3eb.jpeg</url>
      <title>DEV Community: Rajan lagah</title>
      <link>https://dev.to/rajanlagah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajanlagah"/>
    <language>en</language>
    <item>
      <title>What are "Effects" in react?</title>
      <dc:creator>Rajan lagah</dc:creator>
      <pubDate>Wed, 04 Feb 2026 16:51:04 +0000</pubDate>
      <link>https://dev.to/rajanlagah/what-are-effects-in-react-1070</link>
      <guid>https://dev.to/rajanlagah/what-are-effects-in-react-1070</guid>
      <description>&lt;p&gt;Before getting to Effects, you need to be familiar with two types of logic inside React components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rendering code lives at the top level of your component. This is where you take the props and state, transform them, and return the JSX you want to see on the screen. Rendering code must be pure. Like a math formula, it should only calculate the result, but not do anything else.&lt;/li&gt;
&lt;li&gt;Event handlers are nested functions inside your components that do things rather than just calculate them. An event handler might update an input field, submit an HTTP POST request to buy a product, or navigate the user to another screen. Event handlers contain “side effects” (they change the program’s state) caused by a specific user action (for example, a button click or typing).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sometimes this isn’t enough. Consider a ChatRoom component that must connect to the chat server whenever it’s visible on the screen. Connecting to a server is not a pure calculation (it’s a side effect) so it can’t happen during rendering. However, there is no single particular event like a click that causes ChatRoom to be displayed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effects let you specify side effects that are caused by rendering itself, rather than by a particular event.&lt;/strong&gt; Sending a message in the chat is an event because it is directly caused by the user clicking a specific button. However, setting up a server connection is an Effect because it should happen no matter which interaction caused the component to appear. Effects run at the end of a commit after the screen updates. This is a good time to synchronize the React components with some external system (like network or a third-party library).&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>reactjsdevelopment</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Instant AI Text Enhancements in React with prompt-my-client-react</title>
      <dc:creator>Rajan lagah</dc:creator>
      <pubDate>Sun, 31 Aug 2025 16:40:58 +0000</pubDate>
      <link>https://dev.to/rajanlagah/instant-ai-text-enhancements-in-react-with-prompt-my-client-react-4gpp</link>
      <guid>https://dev.to/rajanlagah/instant-ai-text-enhancements-in-react-with-prompt-my-client-react-4gpp</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;
Add AI-powered text transformations—like polish, paraphrase, or translate—to your React app in under 5 minutes using prompt-my-client-react.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It’s Awesome&lt;/strong&gt;&lt;br&gt;
Ready-to-use dropdown UI or hook (&lt;strong&gt;usePrompt&lt;/strong&gt;) for programmatic control&lt;br&gt;
Minimal setup: just install and import&lt;br&gt;
Highly customizable prompts, styling, and callbacks&lt;/p&gt;

&lt;p&gt;Super-Easy Setup&lt;br&gt;
&lt;code&gt;npm install prompt-my-client-react&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Option A: Use the Hook&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;usePrompt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;prompt-my-client-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;generatePrompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;usePrompt&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;onSuccess&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;generatePrompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Make this more professional&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Option B: Use the Dropdown&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AIDropDown&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;prompt-my-client-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;AIDropDown&lt;/span&gt;
  &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;aiResponseCallback&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;Chat apps that paraphrase or translate&lt;/li&gt;
&lt;li&gt;E-commerce product description enhancers&lt;/li&gt;
&lt;li&gt;Internal tools: meeting note summarizers, style improvers, and more!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;If you’re building in React and want AI-powered text features in a snap, check out prompt-my-client-react. Smart apps, no heavy lifting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9wo35ji1c3v0lfzhli71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9wo35ji1c3v0lfzhli71.png" alt="prompt-my-client" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>promptengineering</category>
      <category>javascript</category>
    </item>
    <item>
      <title>🚀 𝗚𝗼 𝘃𝘀. 𝗡𝗼𝗱𝗲.𝗷𝘀 – 𝗦𝘁𝗿𝗲𝘀𝘀 𝗧𝗲𝘀𝘁𝗶𝗻𝗴!</title>
      <dc:creator>Rajan lagah</dc:creator>
      <pubDate>Wed, 02 Apr 2025 05:15:11 +0000</pubDate>
      <link>https://dev.to/rajanlagah/--4pb0</link>
      <guid>https://dev.to/rajanlagah/--4pb0</guid>
      <description>&lt;p&gt;Stress Testing a Go and NodeJS Server&lt;/p&gt;

&lt;p&gt;𝗧𝗲𝘀𝘁 𝗦𝗲𝘁𝘂𝗽&lt;br&gt;
• EC2 Instance: t3.micro on AWS&lt;br&gt;
• Deployment: Elastic Beanstalk&lt;br&gt;
• Database: Same RDS PostgreSQL instance for both servers&lt;/p&gt;

&lt;p&gt;Test 1: 200 users, 1000 requests&lt;br&gt;
Test 2: 200 users, 5000 requests&lt;br&gt;
Test 3: 1000 users, 5000 requests&lt;br&gt;
Test 4: 1000 users, 7000 requests&lt;/p&gt;

&lt;p&gt;𝗥𝗲𝘀𝘂𝗹𝘁𝘀 📊&lt;br&gt;
𝗡𝗼𝗱𝗲.𝗷𝘀&lt;br&gt;
• Avg. resource utilization: 5.67%&lt;br&gt;
• API failures: ~300&lt;br&gt;
𝗚𝗼&lt;br&gt;
• Avg. resource utilization: 2.34%&lt;br&gt;
• API failures: 20&lt;br&gt;
watch a full comparison video &lt;a href="https://lnkd.in/ghBaJUBj" rel="noopener noreferrer"&gt;https://lnkd.in/ghBaJUBj&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆&lt;br&gt;
Go’s efficiency in handling concurrent requests really shines here, using fewer resources and reducing API failures significantly. This test reinforces why Go is a top choice for high-performance, scalable backend systems.&lt;/p&gt;

&lt;p&gt;What’s your take on Go vs. Node.js for backend development? Let’s discuss in the comments! 👇&lt;/p&gt;

&lt;p&gt;💡 Want to master Go and build ultra-fast web servers?&lt;br&gt;
Check out my Udemy course here: 👉 &lt;a href="https://lnkd.in/ghBaJUBj" rel="noopener noreferrer"&gt;https://lnkd.in/ghBaJUBj&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9tdghuxr2eo5zm3u3mu8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9tdghuxr2eo5zm3u3mu8.png" alt="GO vs Nodejs" width="800" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>NodeJS vs GoLang #1</title>
      <dc:creator>Rajan lagah</dc:creator>
      <pubDate>Tue, 11 Mar 2025 05:58:04 +0000</pubDate>
      <link>https://dev.to/rajanlagah/nodejs-vs-golang-1-3f69</link>
      <guid>https://dev.to/rajanlagah/nodejs-vs-golang-1-3f69</guid>
      <description>&lt;p&gt;Stress Testing a Nodejs and Go Server using the &lt;code&gt;hey&lt;/code&gt; CLI tool. &lt;/p&gt;

&lt;p&gt;📝 &lt;strong&gt;Case&lt;/strong&gt;&lt;br&gt;
• 1000 online users &lt;br&gt;
• 2000 concurrent requests &lt;br&gt;
• on a AWS t3.micro EC2 instance&lt;br&gt;
• get a request with a simple Select query.&lt;br&gt;
• same Postgres database on AWS RDS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NodeJS Server&lt;/strong&gt;&lt;br&gt;
 While it handled the load decently, 15 requests failed with a 502 error, and the total execution time was 2.4 seconds. All other 1985 requests pass successfully &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GO Server&lt;/strong&gt;&lt;br&gt;
🔥 Go handled ALL requests with a 200 response!&lt;br&gt;
⏳ Total time?𝟭.𝟮 𝘀𝗲𝗰, Less than half of what Node.js took! &lt;/p&gt;

&lt;p&gt;This proves why Go is a powerhouse for building high-performance, scalable servers. 🚀&lt;br&gt;
Check out the image for the detailed results! 📊&lt;/p&gt;

&lt;p&gt;𝗕𝘂𝘁 𝘄𝗲’𝗿𝗲 𝗻𝗼𝘁 𝗱𝗼𝗻𝗲 𝘆𝗲𝘁!&lt;br&gt;
💡 In the next round, we’ll run the test with medium-level traffic: 100 users sending 1000 requests. Also, check cases where NodeJS outperforms GO. Are you curious to see how both perform under different scenarios? Stay tuned! 𝘛𝘳𝘶𝘴𝘵 𝘮𝘦 𝘵𝘩𝘪𝘯𝘨𝘴 𝘸𝘪𝘭𝘭 𝘨𝘦𝘵 𝘤𝘳𝘢𝘻𝘪𝘦𝘳.&lt;/p&gt;

&lt;p&gt;What are your thoughts on Go vs. Node.js for backend performance? Let’s discuss in the comments! 👇&lt;/p&gt;

&lt;p&gt;P.S. Want to master Go and build ultra-fast web servers? Check out my Go Course on Udemy: &lt;a href="https://www.udemy.com/course/go-web-development-create-powerful-servers-with-golang/?referralCode=EA9B71B7323D2C5D1071" rel="noopener noreferrer"&gt;https://www.udemy.com/course/go-web-development-create-powerful-servers-with-golang/?referralCode=EA9B71B7323D2C5D1071&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fakwy75f45p7i5s2pgsbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fakwy75f45p7i5s2pgsbc.png" alt="NodeJS vs GoLang" width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>go</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Issues with useEffect</title>
      <dc:creator>Rajan lagah</dc:creator>
      <pubDate>Thu, 04 Aug 2022 17:47:02 +0000</pubDate>
      <link>https://dev.to/rajanlagah/issues-with-useeffect-499n</link>
      <guid>https://dev.to/rajanlagah/issues-with-useeffect-499n</guid>
      <description>&lt;p&gt;If you are react dev you surely encounter multiple use cases for useEffect. But let me show how useEffect is tricking you all these times.&lt;/p&gt;

&lt;p&gt;You want some function to run when component mounts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; ...fn() )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything is good here.&lt;/p&gt;

&lt;p&gt;But now you want function to run when some specific state value is changed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; const [data, setData] = useState("");
 useEffect(() =&amp;gt; {
    console.log("Running useEffect");
  }, [data]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;our expectation is that this function will run when data is changed.&lt;/p&gt;

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

&lt;p&gt;Check this small example. Here we can see that useEffect callback ran even if I don't change data.&lt;br&gt;
That is because useEffect will run at least once on component mount.&lt;/p&gt;

&lt;p&gt;So what is fix here?&lt;br&gt;
We all use this to make some api calls and do some critical work and due to this behaviour of useEffect we can face bugs or performance issue. &lt;/p&gt;

&lt;p&gt;So to run it only when data is changed we can.&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, useRef } from "react";

export function App() {
  const isMounted = useRef(false);
  const [data, setData] = useState("");
  useEffect(() =&amp;gt; {
    if (isMounted.current) {
      console.log("HERE");
    } else {
      isMounted.current = true;
    }
  }, [data]);
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;input
        onChange={(e) =&amp;gt; setData(e.target.value)}
        placeholder="First name"
      /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now in the console you will not see HERE on mount.&lt;/p&gt;

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

&lt;p&gt;Notice here we are using useRef specifically so that on re-render value of isMounted persist else with simple js variable it will keep reseting on every mount.&lt;/p&gt;

&lt;p&gt;Hit like if you have learned something awesome.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>react</category>
      <category>performance</category>
    </item>
    <item>
      <title>Web3 connecting wallet</title>
      <dc:creator>Rajan lagah</dc:creator>
      <pubDate>Sun, 29 May 2022 09:29:28 +0000</pubDate>
      <link>https://dev.to/rajanlagah/web3-connecting-wallet-5h56</link>
      <guid>https://dev.to/rajanlagah/web3-connecting-wallet-5h56</guid>
      <description>&lt;p&gt;Utility function for reference&lt;br&gt;
&lt;/p&gt;

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

const getWeb3 = () =&amp;gt; {
  return new Promise((resolve, reject) =&amp;gt; {
    // Wait for loading completion to avoid race conditions with web3 injection timing.
    window.addEventListener("load", async () =&amp;gt; {
      // Modern dapp browsers...
      if (window.ethereum) {
        const web3 = new Web3(window.ethereum);
        try {
          // Request account access if needed
          await window.ethereum.enable();
          // Acccounts now exposed
          resolve(web3);
        } catch (error) {
          reject(error);
        }
      }
      // Legacy dapp browsers...
      else if (window.web3) {
        // Use Mist/MetaMask's provider.
        const web3 = window.web3;
        console.log("Injected web3 detected.");
        resolve(web3);
      }
      // Fallback to localhost; use dev console port by default...
      else {
        const provider = new Web3.providers.HttpProvider(
          "http://localhost:9545"
        );
        const web3 = new Web3(provider);
        console.log("No web3 instance injected, using Local web3.");
        resolve(web3);
      }
    });
  });
};

export { getWeb3 };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change &lt;code&gt;http://localhost:9545&lt;/code&gt; if required.&lt;/p&gt;

&lt;p&gt;Connecting to contract&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const web3 = await getWeb3();
const accounts = await web3.eth.getAccounts();
const networkId = await web3.eth.net.getId();
const deployedNetwork = Multisig.networks[networkId];
const contract = new web3.eth.Contract(
        Multisig.abi,
        deployedNetwork &amp;amp;&amp;amp; deployedNetwork.address,
      );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Solidity</title>
      <dc:creator>Rajan lagah</dc:creator>
      <pubDate>Wed, 25 May 2022 13:14:01 +0000</pubDate>
      <link>https://dev.to/rajanlagah/solidity-597i</link>
      <guid>https://dev.to/rajanlagah/solidity-597i</guid>
      <description>&lt;p&gt;Multiple deeds&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pragma solidity ^0.5.0;

  contract SplitDeed {
    address payable public benificiary;
    uint256 public transferDate;
    address lawyer;`

   constructor(
        address _lawyer,
        address payable _benificiary,
        uint _transferDate
    )
        payable // Allow to send ether on creation of contract
        public
    {
        lawyer = _lawyer;
        benificiary = _benificiary;
        transferDate = _transferDate;

    }

    function withdraw() public{
        require(msg.sender == lawyer, "Lawyer only");
        require(now &amp;gt; transferDate, " Too early ");
        benificiary.transfer(address(this).balance);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Escrow&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pragma solidity ^0.5.2;

contract Escrow{
    address payable public dev;
    address public website;
    address public customer;
    uint public amount;

    constructor( address payable _dev, address _customer,uint _amount) public {
        dev = _dev;
        website = msg.sender;
        customer = _customer;
        amount = _amount;

    }

    function deposit() payable public{
        require(msg.sender == customer, "Only customer can add money");
        require(address(this).balance &amp;lt;= amount, "Money can not exceed given amount");
    }

    function sendMoney() public{
        require(msg.sender == website, "Only website can transfer money");
        require(address(this).balance == amount, "Amount not proper"); 
        dev.transfer(address(this).balance);
    }

    function getBalance() view public returns(uint){
        return address(this).balance;
    }

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

&lt;/div&gt;



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