<?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: travahnetshisaulu</title>
    <description>The latest articles on DEV Community by travahnetshisaulu (@travah1).</description>
    <link>https://dev.to/travah1</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%2F934702%2F16391bd7-ace4-4384-9e1e-a0292c985c30.jpg</url>
      <title>DEV Community: travahnetshisaulu</title>
      <link>https://dev.to/travah1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/travah1"/>
    <language>en</language>
    <item>
      <title>In this article, we'll explore how to build a simple login status monitor using Vanilla JavaScript. We'll cover the basics of user login status management, including storing user data locally and handling login and l</title>
      <dc:creator>travahnetshisaulu</dc:creator>
      <pubDate>Sun, 01 Dec 2024 14:38:34 +0000</pubDate>
      <link>https://dev.to/travah1/in-this-article-well-explore-how-to-build-a-simple-login-status-monitor-using-vanilla-javascript-5ae2</link>
      <guid>https://dev.to/travah1/in-this-article-well-explore-how-to-build-a-simple-login-status-monitor-using-vanilla-javascript-5ae2</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/travah1" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F934702%2F16391bd7-ace4-4384-9e1e-a0292c985c30.jpg" alt="travah1"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/travah1/vanilla-javascript-login-status-monitor-5365" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Vanilla JavaScript Login Status Monitor&lt;/h2&gt;
      &lt;h3&gt;travahnetshisaulu ・ Dec 1&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#css&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#learning&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Vanilla JavaScript Login Status Monitor</title>
      <dc:creator>travahnetshisaulu</dc:creator>
      <pubDate>Sun, 01 Dec 2024 14:18:55 +0000</pubDate>
      <link>https://dev.to/travah1/vanilla-javascript-login-status-monitor-5365</link>
      <guid>https://dev.to/travah1/vanilla-javascript-login-status-monitor-5365</guid>
      <description>&lt;p&gt;In the realm of web development, JavaScript remains a cornerstone technology. While frameworks and libraries can simplify development, mastering Vanilla JavaScript provides a solid foundation for understanding the language’s intricacies. As a best practice, I recommend that developers, especially those new to the field, focus on honing their Vanilla JavaScript skills before exploring frameworks.&lt;/p&gt;

&lt;p&gt;Seamless Server Interaction: Establish a robust communication channel between the client and server, enabling efficient data exchange and synchronization. By implementing a well-designed user login tracking system, developers can significantly enhance the security, performance, and overall quality of their web applications.&lt;/p&gt;

&lt;p&gt;now Lets us dive into the code:&lt;/p&gt;

&lt;p&gt;firstly, lets a variable to access device local storage:&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%2Fkuqbmjdm5r3x2pkbx801.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%2Fkuqbmjdm5r3x2pkbx801.png" alt="Image description" width="604" height="56"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Secondly we gonna create an object variable that has the value of initial/default data. The same data values will be updated whenever new data arrived or changed. here is the variable:&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%2F9l8ykynpmqyzlqd2ubyd.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%2F9l8ykynpmqyzlqd2ubyd.png" alt="Image description" width="604" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now lets create a function to save data into a device local storage:&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%2F6ghfeci0hy5nrng14gk2.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%2F6ghfeci0hy5nrng14gk2.png" alt="Image description" width="600" height="83"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;now lets create our main part of the code, which is our reducer function, this function will be responsible for controlling data by insert, update, delete from our device local storage.&lt;/p&gt;

&lt;p&gt;Here is the code:&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%2Fst2nwe5tod9oe8aqgltk.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%2Fst2nwe5tod9oe8aqgltk.png" alt="Image description" width="668" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Explanation of above code:&lt;/p&gt;

&lt;p&gt;When the action.type is “LOGOUT”, the reducer: Removes/delete the user data from storage using storage.removeItem. Returns a new state object with the following properties: userData: Set to null. timestamp: Set to null. isLoggedIn: Set to false. Default Case JavaScript default: return state; If the action.type doesn’t match any of the above cases, the reducer simply returns the current state without making any changes.&lt;/p&gt;

&lt;p&gt;Finally but not least, the following is the function that will be used as an output of the correct data.&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%2Fb01lz3ykoogbz19b4hb7.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%2Fb01lz3ykoogbz19b4hb7.png" alt="Image description" width="740" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, Our code ensures secure data management by removing user data upon logout. Additionally, we utilize timestamps to enable automatic logout after a prolonged period of inactivity. For a comprehensive implementation, including DOM manipulation examples, please refer to our GitHub repository: &lt;a href="https://github.com/TrevoDng/logig-status-monitor-frontend" rel="noopener noreferrer"&gt;&lt;/a&gt; or &lt;a href="https://github.com/TrevoDng/logig-status-monitor-frontend" rel="noopener noreferrer"&gt;https://github.com/TrevoDng/logig-status-monitor-frontend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks again for reading! Don't forget to subscribe/share/comment if you found this article helpful.&lt;/p&gt;

&lt;p&gt;Author&lt;br&gt;
Trevor Elelwani Netshisaulu.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>css</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
