<?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: GregLimo</title>
    <description>The latest articles on DEV Community by GregLimo (@kipsangagregory).</description>
    <link>https://dev.to/kipsangagregory</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F410118%2F0cc933c3-7c0e-441f-8731-b9cc6f7daa09.png</url>
      <title>DEV Community: GregLimo</title>
      <link>https://dev.to/kipsangagregory</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kipsangagregory"/>
    <language>en</language>
    <item>
      <title>How to execute javascript foreach in series?</title>
      <dc:creator>GregLimo</dc:creator>
      <pubDate>Thu, 25 Nov 2021 06:55:27 +0000</pubDate>
      <link>https://dev.to/kipsangagregory/how-to-execute-javascript-foreach-in-series-m2</link>
      <guid>https://dev.to/kipsangagregory/how-to-execute-javascript-foreach-in-series-m2</guid>
      <description>&lt;p&gt;Hey buddies, On a piece of code I am working on there is a number of async functions that operate on an array of data. The way I would expect to handle this is using the standard forEach function. The problem found is that even if you await in the callback in the for loop this does not help:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const takesLongToRun = async additionalText =&amp;gt; {
  setTimeout (() =&amp;gt; {
    console.log (`Long function done :) ${additionalText}`);
  }, 3000);
};

const mainFunc = async () =&amp;gt; {
  const numbers = [1, 2, 3, 4];

  numbers.forEach (async num =&amp;gt; {
    console.log (num);
    await takesLongToRun (num);
  });
};

mainFunc ();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which outputs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
2
3
4
Long function done :) 1
Long function done :) 2
Long function done :) 3
Long function done :) 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the functions do run in order but it doesn't wait for each value to complete before proceeding to next, what I expect is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
Long function done :) 1
2
Long function done :) 2
3
Long function done :) 3
4
Long function done :) 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After doing a bit of googling I found that this is an issue with forEach and instead the for of syntax seem to solve it in theory. I changed the code as below but still worked the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const mainFunc = async () =&amp;gt; {
  const numbers = [1, 2, 3, 4];
  for (const num of numbers) {
    console.log (num);
    await takesLongToRun (num);
  }
};
mainFunc()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is still the same, I will really appreciate any insight on this from anyone who has experienced it before. Thanks.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Can you use class components with Apollo client 3?</title>
      <dc:creator>GregLimo</dc:creator>
      <pubDate>Fri, 09 Oct 2020 11:40:36 +0000</pubDate>
      <link>https://dev.to/kipsangagregory/can-you-use-class-components-with-apollo-client-3-20a2</link>
      <guid>https://dev.to/kipsangagregory/can-you-use-class-components-with-apollo-client-3-20a2</guid>
      <description>&lt;p&gt;Hello great people... I recently started on with apollo v3, been using react-apollo for long and recently was forced to adopt v3. However, I have gonw through the docs and don't see an instance for use with class components. Ofcos we can't use hooks with class components and although &lt;code&gt;useQuery&lt;/code&gt; and &lt;code&gt;useMutation&lt;/code&gt; hooks are not specific to react, we can't still use them because they start with keyword &lt;code&gt;use&lt;/code&gt;. Anyone please give insight about this. thanks in advance&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Git Revert to certain point in history in remote repo</title>
      <dc:creator>GregLimo</dc:creator>
      <pubDate>Mon, 05 Oct 2020 16:13:29 +0000</pubDate>
      <link>https://dev.to/kipsangagregory/git-revert-to-certain-point-in-history-in-remote-repo-12o</link>
      <guid>https://dev.to/kipsangagregory/git-revert-to-certain-point-in-history-in-remote-repo-12o</guid>
      <description>&lt;p&gt;I am working on a project in which I pushed several commits (more that 10 commits) to master. For some reason I need to revert to the 11th commit back and make that head at master(Jenkins is listening at master), I have no idea the best way to do this coz I have seen some comments warning of a possibility that the repo could be rendered unfunctional...&lt;br&gt;
Will realy appreciate any hint from someone who atleast understands abit of this coz am kinda noob to git/github&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Error fixing and Debugging React Native as a job</title>
      <dc:creator>GregLimo</dc:creator>
      <pubDate>Wed, 26 Aug 2020 16:52:17 +0000</pubDate>
      <link>https://dev.to/kipsangagregory/error-fixing-and-debugging-react-native-as-a-job-2gll</link>
      <guid>https://dev.to/kipsangagregory/error-fixing-and-debugging-react-native-as-a-job-2gll</guid>
      <description>&lt;p&gt;Have been working with React Native Intensively for about a year and half now. Everyone conversant with the React ecosystem, especially React Native must acknowledge having made terms with the Mountain lump of errors that may arise in the process.&lt;br&gt;
     Most of these errors always arise due to the limitations that the React native bridge has in porting Javascript modules with/to native modules. Many times I've had myself trans night trying to look up a solution at GitHub, StackOverflow to no avail, this is always the least you want to see happening as a freelancer working under strict datelines and for a client who might not really get what the whole process entails.&lt;br&gt;
     So today I set out to offer a quick solution by offering to debug as a service. Mainly Targeting React and React Native issues/errors, which might include writing own custom native modules to port to the React side of the app successfully, this isn't really a bug, but a good recipe for the strenuous bugs.&lt;br&gt;
     I know there exist some people already doing this, but I want to dedicate myself to the venture with the aim of honing my skills further and prepare adequately for future projects.&lt;br&gt;
     If you use React/React Native often. You can show some love by saving my gig [&lt;a href="https://www.fiverr.com/share/QrYqo1"&gt;https://www.fiverr.com/share/QrYqo1&lt;/a&gt;] so you can easily reach out upon need.&lt;/p&gt;

&lt;p&gt;Thanks for the read, please leave your comments and feedback below.&lt;/p&gt;

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