<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arek Smyk on Medium]]></title>
        <description><![CDATA[Stories by Arek Smyk on Medium]]></description>
        <link>https://medium.com/@areksmyk?source=rss-daa729daaea2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jIEMIeX9Ac5fDlwC.</url>
            <title>Stories by Arek Smyk on Medium</title>
            <link>https://medium.com/@areksmyk?source=rss-daa729daaea2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 05:13:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@areksmyk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My 3 non-technical tools for someone who wants to be a more productive software developer.]]></title>
            <link>https://medium.com/@areksmyk/my-3-non-technical-tools-for-someone-who-wants-to-be-a-more-productive-software-developer-815948a8a8d?source=rss-daa729daaea2------2</link>
            <guid isPermaLink="false">https://medium.com/p/815948a8a8d</guid>
            <category><![CDATA[health]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[skills-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Arek Smyk]]></dc:creator>
            <pubDate>Fri, 18 Jan 2019 13:24:31 GMT</pubDate>
            <atom:updated>2019-01-18T14:57:54.509Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I’m sharing with you my top 3 tips which had a big impact on my results as a software engineer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AS2ip2oH_Ol6H5xk8KAzyw.png" /><figcaption>focus…</figcaption></figure><p>I’ve always been curious about productivity, especially in engineering. In general, software engineers are measured by their results. During my career, I tried many things that could help me to be a better developer. Let me share my 3 most important tips/routines:</p><h3>1. Diet</h3><p>Tried many kinds of diets but the <a href="https://en.wikipedia.org/wiki/Intermittent_fasting">Intermittent Fasting</a> is the best. I’m on 18–6, it means 18h fasting and 4h eating window. There are 3 super-important reasons to implement this eating system:</p><p>1. <strong>Time-saving </strong>= you will save a lot of time on meals preparations and other time-consuming activities. <br>2. <strong>Ability to focus is awesome</strong>. I’m most productive during fasting. It’s like nothing can distract your brain, and you can completely focus on the job. You will have a constant amount of energy during the day.<br>3. <strong>Fat loss and detoxication. </strong><br>This is the easiest and effective eating system that I ever saw.</p><h3>2. When focus — focus, when relax — relax.</h3><p>Just try to not connect work and relax together :) This is it, no more. <strong>When it’s working time — focus on work. When it’s a fun time — have as much fun as you can. </strong>But if you want to be a top performer — do only <strong>one</strong> of those two things at the time.</p><h3>3. Find a hobby not related to IT.</h3><p>This will prevent you to burn out. Very important topic. <strong>Everybody needs some creative space in life. </strong>Experiment with things, have fun, try something completely new from time to time. Then you will see how many great ideas come to you :)</p><p>Those three things are my most important non-technical tools. All 3 are very simple, but in long-term, they are super effective. You can share your tips/tools below :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=815948a8a8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular - how to handle multiple API enviroments]]></title>
            <link>https://medium.com/@areksmyk/angular-how-to-handle-multiple-api-enviroments-9ff500739359?source=rss-daa729daaea2------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ff500739359</guid>
            <category><![CDATA[services]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Arek Smyk]]></dc:creator>
            <pubDate>Mon, 02 Jul 2018 18:42:14 GMT</pubDate>
            <atom:updated>2018-07-02T18:43:48.153Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular — how to handle multiple API enviroments</h3><p>I would like to share with you my simple idea about how to use Angular features for API handling in many environments.</p><p>There are many approaches to this problem, but let me share my idea which is simple and easy to understand and implement :)</p><p>The common scenario for many web apps is having at least two backend environments. First one is a local server, where we can mock data. And the second one is a production server. Now, our challenge is to handle the transition between environments in an elegant way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tk95fw4DuXH6C2FUDWAQYg.jpeg" /><figcaption>Main concept :) sorry for my penmanship :D</figcaption></figure><p>Look at the following sample:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b0706d6f5a1c82515aec5e3448539a6/href">https://medium.com/media/7b0706d6f5a1c82515aec5e3448539a6/href</a></iframe><p>There is simple service which can fetch user list from the server. This service and others don’t know explicit what is the target URL. The only thing they need to know is a method name.</p><p>Next step is to add an interceptor to our HTTP calls. Interceptors allow us to access request before executing call, modify and pass request forward. Our goal is:</p><ol><li>intercept outgoing requests</li><li>set correct URL depending on desired enviroment</li><li>pass request forward.</li></ol><p>We don’t need to connect interceptors with services — this will be done by Angular and DI.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d91efdbf937d8b1f8018f7321ac8f1e/href">https://medium.com/media/1d91efdbf937d8b1f8018f7321ac8f1e/href</a></iframe><p>In the example above method, the intercept is invoked every time when a user makes an HTTP request call. Now, we need to get API URL from config service. At this point, UrlInterceptor and Service don’t know if we are on production or on local env. We outsource that logic to the config service.</p><p>Here is example project:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fangular6-api-url-interceptor%3Fembed%3D1&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fangular6-api-url-interceptor&amp;image=https%3A%2F%2Fc.staticblitz.com%2Fassets%2Ficon-664493542621427cc8adae5e8f50d632f87aaa6ea1ce5b01e9a3d05b57940a9f.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/544b47281e4ff9123830473f1526ba39/href">https://medium.com/media/544b47281e4ff9123830473f1526ba39/href</a></iframe><p>This is a very simple idea for handling many env’s. I hope you like it. Don’t hesitate to leave a comment or PM me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ff500739359" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forms in react and react-native]]></title>
            <link>https://medium.com/@areksmyk/forms-in-react-and-react-native-469db3ce9ba?source=rss-daa729daaea2------2</link>
            <guid isPermaLink="false">https://medium.com/p/469db3ce9ba</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[recompose]]></category>
            <dc:creator><![CDATA[Arek Smyk]]></dc:creator>
            <pubDate>Wed, 21 Mar 2018 14:20:01 GMT</pubDate>
            <atom:updated>2018-03-21T14:20:01.598Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Building a generic form handling component for react and react native with recompose.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ydGbidsdnYCOn0kVlQmVQ.jpeg" /></figure><p>Let’s think about the generic way to handle form in react and react native. I will share with you my idea to separate form handling actions from the component. It can be used in any react-like components — no matter if you using react for web or react native.</p><h4>Standard approach</h4><p>In standard approach, you can easily use a state in the component to maintain data. Look at following example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb5225f47b57afd831b54d9322b791f8/href">https://medium.com/media/eb5225f47b57afd831b54d9322b791f8/href</a></iframe><p>There are two key problems with this approach.</p><ol><li>You have to copy-paste a lot of code everytime you want to add a form.</li><li>And second — you can’t share code between react and react-native components.</li></ol><h4>Recompose</h4><p>I think it’s better to left components “dumb” and move out heavy code(validation etc.) away from components. This can separate what we render from how things behave.</p><p>I find out that recompose works well for my needs. This library has a lot of useful HOC’s that can be mixed in many ways.</p><p>Look at a simple example. We pass some data to our form component and handler for submitting action:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0c6eddecd00e7429893fa3652f019b0/href">https://medium.com/media/c0c6eddecd00e7429893fa3652f019b0/href</a></iframe><p>Now, form component can receive data from outside. Also, logic related with submit handler is separated from component too. This gives us clean and consistent code which can be used in react and react-native.</p><h4>Forms recomposed</h4><p>Let’s say we want to add some validation to our form. We can start from match fields that have to be validated with validation functions. Validation function will check if given value is correct, if not — just return an error message.</p><p>Every time when user clicks on form send — we iterate over every form field, then run validation functions. If there are no errors — form is valid and user can go forward.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a3d92bb7698499f956a3781d6d2c024/href">https://medium.com/media/1a3d92bb7698499f956a3781d6d2c024/href</a></iframe><p>As you may see there are two new HOC called “withFormData” and “withFormHandlers”.</p><ol><li>withFormData — get initial form state and pass this state to component</li><li>withFormHandlers — handle form validation and invoke onSuccess or onFail</li></ol><p>Look at my implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e28f595bd1c8450b099bf906855acc5/href">https://medium.com/media/6e28f595bd1c8450b099bf906855acc5/href</a></iframe><p>Now you can use this two components in any form component. React and react-native will handle it as well. You can check out example source code at my github <a href="https://github.com/asmyk/react-universal-forms-example">https://github.com/asmyk/react-universal-forms-example</a> or look at expo sample here: <a href="https://expo.io/@asmyk/react-native-forms-example">https://expo.io/@asmyk/react-native-forms-example</a></p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=469db3ce9ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>