<?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: Filip</title>
    <description>The latest articles on DEV Community by Filip (@filipjelic).</description>
    <link>https://dev.to/filipjelic</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%2F49373%2F1618bb31-ee02-4808-99c8-c6f0732bd3f8.jpeg</url>
      <title>DEV Community: Filip</title>
      <link>https://dev.to/filipjelic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/filipjelic"/>
    <language>en</language>
    <item>
      <title>react-activity-detector - Check if the user is idle</title>
      <dc:creator>Filip</dc:creator>
      <pubDate>Sun, 24 Jan 2021 17:14:39 +0000</pubDate>
      <link>https://dev.to/filipjelic/my-first-npm-reactjs-package-4192</link>
      <guid>https://dev.to/filipjelic/my-first-npm-reactjs-package-4192</guid>
      <description>&lt;p&gt;I haven't been active in the OS community, or here, but that might change!&lt;br&gt;
Most of my career I was focused on the backend (C# and partially Java), but I felt that I need push myself to something new.&lt;br&gt;
New projects came, and required me to push myself from my comfort zone, and required me to learn ReactJS, and before that JavaScript.&lt;br&gt;
I must say, it's a lot of fun working with ReactJS (in good and bad way).&lt;br&gt;
It's pretty easy to pickup (mostly saying this since I have spend a lot of time working with strong typing languages like C# and Java).&lt;/p&gt;
&lt;h1&gt;
  
  
  Now, to the package!
&lt;/h1&gt;

&lt;p&gt;You can check the package on &lt;a href="https://www.npmjs.com/package/react-activity-detector"&gt;react-activity-detector&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What's its purpose?&lt;br&gt;
If you have an app, and need to detect if the user is idle after N seconds/minutes/hours + cross tab functionality!&lt;/p&gt;

&lt;p&gt;How to implement it&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="nx"&gt;ActivityDetector&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;react-activity-detector&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="nx"&gt;customActivityEvents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;keydown&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;signOut&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The user is loged out&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&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;ActivityDetector&lt;/span&gt; &lt;span class="nx"&gt;activityEvents&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;customActivityEvents&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;isActive&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;signOut&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;signOut&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;You can find more on the &lt;a href="https://www.npmjs.com/package/react-activity-detector"&gt;link&lt;/a&gt;, and to check out the code you can visit &lt;a href="https://github.com/filipjelic/react-activity-detector"&gt;github.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Just a note, it's still in early stage and I would be grateful for any suggestions or feedbacks!&lt;/p&gt;

</description>
      <category>react</category>
      <category>npm</category>
      <category>idle</category>
      <category>active</category>
    </item>
    <item>
      <title>Explain Activity Lifecycle Like I'm Five</title>
      <dc:creator>Filip</dc:creator>
      <pubDate>Thu, 01 Feb 2018 11:43:08 +0000</pubDate>
      <link>https://dev.to/filipjelic/explain-activity-lifecycle-like-im-five-3lgk</link>
      <guid>https://dev.to/filipjelic/explain-activity-lifecycle-like-im-five-3lgk</guid>
      <description></description>
      <category>explainlikeimfive</category>
      <category>android</category>
    </item>
  </channel>
</rss>
