<?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 Jamie Barton on Medium]]></title>
        <description><![CDATA[Stories by Jamie Barton on Medium]]></description>
        <link>https://medium.com/@notrab?source=rss-1ed0fbea8a55------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*t7BL1Gfpo1GQAtpqQhLe-w.jpeg</url>
            <title>Stories by Jamie Barton on Medium</title>
            <link>https://medium.com/@notrab?source=rss-1ed0fbea8a55------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 04:53:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@notrab/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[Launch your own dropshipping store, for free.]]></title>
            <link>https://medium.com/@notrab/launch-your-own-dropshipping-store-for-free-bcef5838a7b7?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcef5838a7b7</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[headless-commerce]]></category>
            <category><![CDATA[dropshipping]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Tue, 04 May 2021 08:34:24 GMT</pubDate>
            <atom:updated>2021-05-06T11:09:12.877Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ew3YhDgmDhjsqiXLQXMK1g.png" /></figure><p>Today I am incredibly pleased to announce that <a href="https://headlessdropshipping.com/">HeadlessDropshipping.com</a> has launched.</p><p>It’s free, and available to build with today over on <a href="https://github.com/notrab/headless-dropshipping-starter">GitHub</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FepcysiCJ3l4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DepcysiCJ3l4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FepcysiCJ3l4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/386fec4f158a9b4397ceeb0b9197dc7c/href">https://medium.com/media/386fec4f158a9b4397ceeb0b9197dc7c/href</a></iframe><p>Build your own Headless eCommerce storefront with Next.js and <a href="https://snipcart.com/jamstack-ecommerce">Snipcart</a>, and deliver swag powered by Printful. End to end commerce, styled using TailwindCSS and deployed on Vercel.</p><p>It has lots of great features, and all you need to do is create your inventory, connect your payment gateway, and click deploy!</p><p>* Realtime shipping prices<br>* Secure payments<br>* Automatic fulfillment<br>* Built with Next.js<br>* Cart &amp; Checkout with Snipcart<br>* Styled with Tailwind CSS<br>* Fully Typed<br>* Recover abandoned carts<br>* One click deploy</p><p>I launched over on <a href="https://www.producthunt.com/posts/headless-dropshipping-starter">Product Hunt</a> if you want to support me there also. I’d love any questions or comments 💜</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcef5838a7b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get up and running with Tailwind CSS and Next.js]]></title>
            <link>https://medium.com/@notrab/get-up-and-running-with-tailwind-css-and-next-js-ba1b78cb9498?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba1b78cb9498</guid>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[postcss]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[css-modules]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Fri, 23 Nov 2018 10:25:57 GMT</pubDate>
            <atom:updated>2020-01-11T14:10:39.816Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://dev.to/notrab/get-up-and-running-with-tailwind-css-and-next-js-3a73">Post moved to Dev.to</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba1b78cb9498" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FakerQL — The ultimate GraphQL endpoint for fake data]]></title>
            <link>https://medium.com/@notrab/fakerql-is-ultimate-graphql-endpoint-for-fake-data-bd83f4cd6ad1?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd83f4cd6ad1</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[fakers]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Thu, 11 Jan 2018 17:18:01 GMT</pubDate>
            <atom:updated>2019-12-05T15:42:23.175Z</atom:updated>
            <content:encoded><![CDATA[<h3>FakerQL — The ultimate GraphQL endpoint for fake data</h3><p><a href="https://fakerql.com/"><strong>FakerQL</strong></a> is a hosted GraphQL endpoint that allows you to send queries, mutations and subscriptions for totally fake data, courtesy of <a href="https://github.com/marak/Faker.js/">faker.js</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkV3LQ04c5RkSrA0eJgGbQ.png" /><figcaption>fakerql.com</figcaption></figure><p>Edit: FakerQL is no longer. I recommend you check <a href="https://www.apollographql.com/docs/apollo-server/testing/mocking">Apollo Server Mocking</a>.</p><h4>What?</h4><p>FakerQL is great for frontend developers building GraphQL powered apps or GitHub demos. If you’re learning <a href="https://www.apollographql.com/client/">Apollo Client</a>, FakerQL gives you the following Types you can query;</p><ul><li>Post</li><li>Product</li><li>User</li><li>Todo</li></ul><p>There are also various mutations available that provide fake responses used in everyday development;</p><ul><li>register</li><li>login</li><li>updateUser</li><li>createTodo</li></ul><p>The login and register mutations return a <a href="https://jwt.io/">JWT</a> which is great for applications that require authentication.</p><h4>Why?</h4><p>The project started a video series teaching others how to use Apollo Server to build GraphQL servers but I soon decided to grab a domain and deploy it.</p><p>Visit <a href="https://fakerql.com/">fakerql.com</a> to see it in action!</p><h4>How?</h4><p>You can send requests to <a href="https://fakerql.com/graphql">https://fakerql.com/graphql</a> via a library like <a href="https://github.com/graphcool/graphql-request">graphql-request</a>, via schema stitching, the hosted GraphiQL or plain old REST.</p><p>Below is an example using graphql-request that calls for a list of 25 products and a User by id, both completely faked results.</p><pre>import { request } from &#39;graphql-request&#39;;<br><br>const query = `{<br>  products: allProducts(count: 25) {<br>    id<br>    name<br>    price<br>  }<br><br>  user: User(id: &quot;wk0z1j1tzj7xc0116is3ckdrx&quot;) {<br>    id<br>    firstName<br>    lastName<br>    email<br>    avatar<br>  }<br>}`;<br><br>request(&#39;https://fakerql.com/graphql&#39;, query).then(data =&gt; console.log(data));</pre><h3>Going forward</h3><p>The application is completely <a href="https://github.com/notrab/fakerql">available on GitHub</a>. You can submit a PR for any additional queries/mutations that are useful.</p><p>I hope this project helps other’s getting started with Apollo + GraphQL and removes the worry of building an actual GraphQL server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd83f4cd6ad1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a Node.js GraphQL Server]]></title>
            <link>https://medium.com/@notrab/create-a-node-js-graphql-server-9dd41e895609?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dd41e895609</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[apollo]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[facebook]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Mon, 10 Jul 2017 12:15:44 GMT</pubDate>
            <atom:updated>2017-07-10T12:15:44.622Z</atom:updated>
            <content:encoded><![CDATA[<p>GraphQL has been part of my daily routine for a few months and it took some time to learn. I reduced the GraphQL learning curve by using self-hosted <a href="https://www.graph.cool/">GraphQL backends</a> but as soon as I understood how <a href="https://github.com/apollographql/apollo-client">Apollo Client</a> worked, I wanted to learn how the <a href="https://en.wikipedia.org/wiki/Server-side">server side</a> worked!</p><p>Being a huge fan of JavaScript I took the <a href="https://nodejs.org/en/">Node.js</a> server implementation approach and discovered <a href="https://github.com/graphql/express-graphql">express-graphql</a> and <a href="https://github.com/apollographql/graphql-server">graphql-server</a> repos.</p><p>I decided to share my experience in a video series demonstrating how to <a href="https://www.youtube.com/watch?v=0hOi7biFLf0">create a GraphQL server using Node.js</a> to hopefully help you get started with GraphQL.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0hOi7biFLf0%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0hOi7biFLf0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0hOi7biFLf0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e12b6821ea56cb802c7c6da89ee2ef9/href">https://medium.com/media/3e12b6821ea56cb802c7c6da89ee2ef9/href</a></iframe><p>Let me know what you think in the comments below, on <a href="https://www.youtube.com/watch?v=0hOi7biFLf0">YouTube</a> &amp; on Twitter.</p><p>#HappyCoding 💚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dd41e895609" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get up and running with Create React App, Apollo Client and Graphcool]]></title>
            <link>https://medium.com/@notrab/get-up-and-running-with-create-react-app-apollo-client-and-graphcool-ac090367de98?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac090367de98</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[create-react-app]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[apollo]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Tue, 30 May 2017 09:29:05 GMT</pubDate>
            <atom:updated>2017-08-11T08:10:10.293Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqJDJVOdXiqc8SJujlR0Ag.png" /></figure><p>In this short tutorial we will connect together <a href="https://github.com/facebookincubator/create-react-app">create-react-app</a>, <a href="https://github.com/apollographql/react-apollo">react-apollo</a> and popular GraphQL backend service <a href="https://graph.cool/">Graphcool</a>.</p><p>If you’d rather just get started, the code for this tutorial is <a href="https://github.com/notrab/create-react-app-apollo">available on GitHub</a>. If you’ve rather listen and follow along, the video is below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmOeMk715MIA%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmOeMk715MIA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmOeMk715MIA%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/232227afb64f8cf22f8388f9b789b564/href">https://medium.com/media/232227afb64f8cf22f8388f9b789b564/href</a></iframe><p>Create React App is a great way to get started building your React applications without the hassle to configure Babel, Webpack and a production build process.</p><p>To get started, make sure you have create-react-app installed globally. You can use npm to do this.</p><pre>npm install -g create-react-app</pre><h4>Creating our project</h4><p>Let’s get started by using the create-react-app library to build our application. Inside a new terminal window, pick a name for your new project. In this tutorial we’re using example-app.</p><pre>create-react-app example-app</pre><p>When this finishes, you’ll want to change directory to our new application. cd example-app will do just that 💥.</p><h4>Installing our dependencies</h4><p>In this tutorial we are going to use Apollo Client for our GraphQL implementation. <a href="https://facebook.github.io/relay/">Relay</a> is also a great choice if you’ve heard of that.</p><p>Within /example-app you’ll want to install the react-apollo dependency.</p><pre>yarn add react-apollo</pre><h4>Configuring our dependencies</h4><p>Open src/index.js and import our dependencies.</p><pre>import {<br>  ApolloProvider,<br>  ApolloClient,<br>  createNetworkInterface<br>} from &#39;react-apollo&#39;</pre><p>⚠️ Make sure you’re importing these at the top of your file amongst your other imported modules. Create React App will shout at you if place them somewhere else.</p><h4>Creating a network interface</h4><p>Next we need to configure our networking interface for React &amp; Apollo to talk.</p><pre>const networkInterface = createNetworkInterface({<br>  uri: process.env.REACT_APP_GRAPHQL_URI<br>})</pre><p>In order to hook up a uri for Apollo Client, you’ll need a GraphQL endpoint. If you have a GraphQL backend already, use that, otherwise head to <a href="https://graph.cool/">Graphcool</a> and Sign Up.</p><p>Create a new project, give it any name for name and copy your Simple endpoint to the clipboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*MuN0TdpF1phBtA1ELnHSFw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sl_Xqg1snmVW6HdXYnzIjA.gif" /></figure><p>It’s recommended you store the uri inside an environment variable. Create a file called .env and set REACT_APP_GRAPHQL_URI to your copied Graphcool endpoint.</p><h4>Creating our Apollo Client</h4><p>Next we need to create an instance of ApolloClient to use within our ApolloProvider higher order component.</p><pre>const client = new ApolloClient({<br>  networkInterface,<br>  dataIdFromObject: o =&gt; o.id,<br>  connectToDevTools: process.env.NODE_ENV === &#39;development&#39;<br>})</pre><p>connectToDevTools is enabled in development using an ENV flag. You can find details on how to install Apollo Dev Tools <a href="https://github.com/apollographql/apollo-client-devtools">on GitHub</a>.</p><h4>Connecting App to Apollo Client</h4><p>We’ve now got everything setup to tell our App about Apollo. We do this by using the Higher Order Component ApolloProvider. This connects with Redux if you’re using that 🎉.</p><p>You’ll want to replace what’s inside inside ReactDOM.render().</p><pre>ReactDOM.render(<br>  &lt;ApolloProvider client={client}&gt;<br>    &lt;App /&gt;<br>  &lt;/ApolloProvider&gt;,<br>  document.getElementById(&#39;root&#39;)<br>)</pre><h4>Starting the app!</h4><p>That’s it! Create React App + Apollo Client are configured and ready to go.</p><p>Head over the terminal and type yarn start to start your application. In the next tutorial we will query Apollo Client for some data from GraphQL. 🤘</p><p>I’ve more tutorials and videos on <a href="https://www.youtube.com/channel/UCcSj41xzQJCT2V0GNwlob_w">YouTube</a>. Subscribe? ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac090367de98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You were awesome GraphQL Europe ]]></title>
            <link>https://medium.com/@notrab/you-were-awesome-graphql-europe-a5d2f71b40cf?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5d2f71b40cf</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Mon, 22 May 2017 17:33:10 GMT</pubDate>
            <atom:updated>2017-05-22T17:33:10.210Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m sat waiting to board one of my two flights from Berlin to England and not only am I reflecting on <a href="https://graphql-europe.org/">GraphQL Europe</a> but what has been a rollercoaster ride with React since the beginning of the year.</p><p>In the beginning my brain and the magic of GraphQL just didn’t seem to get each other. This went on for many months. <em>Why would anyone drop </em><a href="https://en.wikipedia.org/wiki/Representational_state_transfer"><em>REST</em></a><em> in favour of GraphQL? </em><a href="https://en.wikipedia.org/wiki/SOAP"><em>SOAP</em></a><em> I’d understand! 😏</em></p><p>I’d spent months seeing GraphQL popup in conversations on Twitter and it big companies like GitHub and Spotify were allocating teams to work on this implementation, so I knew it was time I joined in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g_7ix6fgFaGyGI5ZDZIbOg.jpeg" /></figure><p>I had no idea where to begin and if I should be using Relay or Apollo. Relay seemed to do too much but Apollo appeared to do too little. It was super cool to hear others I met at GraphQL Europe went through the same thing. I was also super happy when <a href="https://twitter.com/helferjs">Jonas Helfer</a> touched on this during his keynote.</p><p>#JuniorDevForLife right?</p><p><a href="https://twitter.com/stubailo">Sashko Stubailo</a> presented a brilliant talk on adding GraphQL to your existing architecture. A large chunk of examples with React &amp; GraphQL today often show how to get started but leave out the real world problems.</p><p>Quite often that’s for us as a developer to “figure out”. Using GraphQL in development is very different to what it’s actually like in production but that shouldn’t stop you from diving in and getting started with GraphQL in your existing projects.</p><p>Everyone at <a href="http://graph.cool/">Graphcool</a> &amp; <a href="https://www.honeypot.io/">Honeypot</a> did a fantastic job organising this conference. <a href="https://twitter.com/chadfowler">Chad Fowler</a> also did a great job as MC, even if he did drop some Trump &amp; Rails jokes.</p><p>HUGE THANKS to Johannes and Lee Byron for taking the time to listen to my experience and ideas.</p><h3>Jamie Barton on Twitter</h3><p>Great day/night and plenty ideas after talking to @leeb @graphqleu 🇪🇺 #GraphQLEU</p><p>If you are a frontend developer and you want to learn GraphQL, you should learn<strong> </strong><a href="https://github.com/apollographql/apollo-client">Apollo Client</a> and leave the backend to <a href="https://graph.cool/">Graphcool</a>. This should get you from <strong>zero to hero</strong> quickly!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*kUcW_z3jXOWnGvOlW4Tl5w.png" /><figcaption>graph.cool</figcaption></figure><p>Now what are you waiting for? Get started with GraphQL today! You might find the following repos quite helpful to get started.</p><ul><li><a href="https://github.com/graphcool-examples">graphcool/graphcool-examples</a></li><li><a href="https://github.com/notrab/create-react-app-apollo">notrab/create-react-app-apollo</a></li><li><a href="https://github.com/notrab/create-react-app-apollo-redux">notrab/create-react-app-apollo-redux</a></li></ul><p>Can’t wait to attend GraphQL Europe next year! 🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5d2f71b40cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with create-react-app, Redux, React Router & Redux Thunk]]></title>
            <link>https://medium.com/@notrab/getting-started-with-create-react-app-redux-react-router-redux-thunk-d6a19259f71f?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6a19259f71f</guid>
            <category><![CDATA[react-app]]></category>
            <category><![CDATA[react-router]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Wed, 22 Feb 2017 12:08:04 GMT</pubDate>
            <atom:updated>2018-07-18T00:22:46.537Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>tldr</em></strong><em>; You can clone my </em><a href="https://github.com/notrab/create-react-app-redux"><em>GitHub repo</em></a><em> and skip the walkthrough or watch videos like this on </em><a href="https://www.youtube.com/channel/UCcSj41xzQJCT2V0GNwlob_w">YouTube</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6czub9YyW8AVJpFlIgaDUQ.png" /></figure><h4>We are going to build the following</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*lrkKV5vTNDoTZr6IM5I6eQ.gif" /><figcaption>Our working example 🤘</figcaption></figure><p>There is a fantastic tool on the block endorsed by React that boasts “<a href="https://facebook.github.io/react/blog/2016/07/22/create-apps-with-no-configuration.html">no configuration necessary</a>”.</p><p>I use <a href="https://github.com/facebookincubator/create-react-app">create-react-app</a> for every new React application. <strong>It’s so good</strong> 💯.</p><p>The great thing Create React App has bundled is the eject tool, which allows you to completely disconnect and add your own advanced configuration.</p><p><em>Seriously though, </em><strong><em>this is not required</em></strong><em> to add things like Redux, React Router &amp; Redux Thunk.</em></p><p>This tutorial assumes you have a good fair understanding of Redux. Check out <a href="https://egghead.io/courses/getting-started-with-redux">this tutorial</a> on Egghead by Dan Abramov if you want to see what all the Redux fuss is about.</p><h3>Let’s get to it!</h3><p>Let’s go ahead and create a new React app.</p><pre>npx create-react-app react-redux-example<br>cd react-redux-example</pre><p>Before we add any code, let’s go ahead and install all our dependencies.</p><pre>npm install --save redux react-redux react-router-dom connected-react-router redux-thunk history</pre><p><strong><em>Note</em></strong><em>: All of the files we’ll create below are to be saved within the </em><em>src directory.</em></p><h3>1. The Store</h3><p>Everything in Redux belongs in a single store. Let’s configure our store to understand react-router and redux-thunk.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20b8d769144c66f493e2682a8059ebdb/href">https://medium.com/media/20b8d769144c66f493e2682a8059ebdb/href</a></iframe><p>Within our store, we’re importing a few core modules from Redux that allows us to create a custom global store. connected-react-router and redux-thunk are both known as middleware to Redux and we need to configure our store to treat them that way.</p><p>You’ll notice we’re importing a file we haven’t yet created called rootReducer.<strong> This is essential to Redux</strong>. <em>We’ll come back to Reducers later</em> but for now, create a file called ./src/modules/index.js so we can satisfy our Store.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/16f72c665e784f51ce806dff1303c81f/href">https://medium.com/media/16f72c665e784f51ce806dff1303c81f/href</a></iframe><p>Our store const creates a store using the Redux createStore function. It accepts a rootReducer, initialState and an enhancer in this example.</p><p>Our history const syncs our browserHistory with our store and must be exported so we can use it within our routes later.</p><p>We also must export our storeconst as the default module so that it can also be used later.</p><h3>2. Routes</h3><p>This tutorial uses React Router v4 which allows us to mount components anywhere inside our application when a given url matches our defined parameters.</p><p>In previous versions of React Router you might see files like routes.js which contain a long list of nested routes but React Router v4 does routing a little differently.</p><p>Our router history is managed inside our Redux store which we created in the first section and is passed down via something called ConnectedRouter which we will implement later.</p><p>We’ll get started by defining which components to show at what url in our first container component App.</p><h3>3. Containers</h3><p>First, create our App component that renders navigation and any matching routes inside a main tag.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08abb1138022736868656ff450a10fe4/href">https://medium.com/media/08abb1138022736868656ff450a10fe4/href</a></iframe><p>Now let’s create our Home component that we defined to show at the exact path of /.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c6a8e5f43bdf2c415b3a3f36245eaf8/href">https://medium.com/media/6c6a8e5f43bdf2c415b3a3f36245eaf8/href</a></iframe><p>This should be straight forward for those who have used Redux before but what is special in this example is we can import push from connected-react-router and use within our action creator.</p><p>Since our Store knows about connected-react-router it can manage and act on routing actions. Magic! 💥</p><p>Finally, create the About component to allow our router to actually do something.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56ef08f3675bc77ef3467ac090ad650c/href">https://medium.com/media/56ef08f3675bc77ef3467ac090ad650c/href</a></iframe><h3>4. Rendering our app</h3><p>The time has come to mount our application.</p><p>We need to tell react-dom to render our application with the correct store and browser history data. We do this by using the ConnectedRouter export given to us by React Router v4. ConnectedRouter has access to the store given to Provider so you don’t need to worry about passing data through any additional props.</p><p>React Router magic 💥!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/119497ef9fa0623bd6330bd96974a6d5/href">https://medium.com/media/119497ef9fa0623bd6330bd96974a6d5/href</a></iframe><h3>5. Adding Redux Thunk</h3><p>It’s 2018 and your React application is most likely going to be crawling with async functions. <a href="https://github.com/gaearon/redux-thunk">Redux Thunk</a> is middleware for Redux that allows you to write action creators that return a function instead of an action.</p><p><em>That totally made no sense, so let’s see an example!</em></p><p>Let’s go ahead and create some actions and a reducer for a counter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ecf1d8a2e2984712adf554cf688cd0f3/href">https://medium.com/media/ecf1d8a2e2984712adf554cf688cd0f3/href</a></iframe><p>Our incrementAsync and decrementAsync functions return a Thunk. We first dispatch an action and we wrap another function within setTimeout() which dispatches when the timer is up. 🙌</p><p>We’ll need to hook up our counter.js to our rootReducer so our store can manage our state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c104dee4c43c2b9892ef86d87e8847c1/href">https://medium.com/media/c104dee4c43c2b9892ef86d87e8847c1/href</a></iframe><p>To complete our thunk example, let’s update our Home container component to include our Counter state and actions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20e84c53626d15fe69b3b53f31ae3521/href">https://medium.com/media/20e84c53626d15fe69b3b53f31ae3521/href</a></iframe><h3>Try it out!</h3><p>The time has come to fire up our React app using yarn start. You can see below our efforts in action! See this <a href="https://cra-redux-router-thunk.herokuapp.com/">live on Heroku</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*lrkKV5vTNDoTZr6IM5I6eQ.gif" /><figcaption>Our working example 🤘</figcaption></figure><p>I’ve more tutorials and videos on <a href="https://www.youtube.com/channel/UCcSj41xzQJCT2V0GNwlob_w">YouTube</a>. Subscribe? ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6a19259f71f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using create-react-app with hapi.js]]></title>
            <link>https://medium.com/@notrab/using-create-react-app-with-hapi-js-8f4ef3dcd311?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f4ef3dcd311</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[create-react-app]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Tue, 21 Feb 2017 15:41:26 GMT</pubDate>
            <atom:updated>2017-02-23T09:40:32.041Z</atom:updated>
            <content:encoded><![CDATA[<p>This short guide will easily show you how to use <a href="https://hapijs.com/">hapi.js</a> with the popular <a href="https://github.com/facebookincubator/create-react-app">create-react-app</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EayVq4qv4ZrsHcEAxNCV5A.png" /></figure><p><strong>I often use hapi to proxy my API requests within React.</strong> There are countless Express guides showing you how to do this but <em>I haven’t found one for hapi</em> that screams simplicity.</p><p><strong>First</strong>, you’ll need to install hapi itself and <a href="https://github.com/hapijs/inert">inert</a>, a hapi plugin.</p><pre>yarn add hapi inert</pre><p><strong>Next</strong>, create a server.js file and paste the following:</p><pre>const Hapi = require(&#39;hapi&#39;)<br>const Path = require(&#39;path&#39;)<br><br>const server = new Hapi.Server()<br><br>const plugins = [<br>  require(&#39;inert&#39;)<br>]<br><br>server.register(plugins, err =&gt; {<br>  if (err) {<br>    throw err<br>  }<br><br>  server.connection({<br>    host: process.env.HOST || &#39;localhost&#39;,<br>    port: process.env.PORT || 5000<br>  })<br><br>  server.route({<br>    method: &#39;GET&#39;,<br>    path: &#39;/{path*}&#39;,<br>    handler: {<br>      directory: {<br>        path: Path.join(__dirname, &#39;build&#39;),<br>        listing: false,<br>        index: true<br>      }<br>    }<br>  })<br><br>  server.start(err =&gt; {<br>    if (err) {<br>      throw err<br>    }<br><br>    console.log(`Server running at ${server.info.uri}`)<br>  })<br>})</pre><p><strong>Finally</strong>, when you deploy your server or run yarn run build you can then start your server by typing node server.</p><p>Enjoy 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f4ef3dcd311" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ It’s time you actually focus on working and not responding to emails.]]></title>
            <link>https://medium.com/@notrab/its-time-you-actually-focus-on-working-and-not-responding-to-emails-4389f1c75ea8?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/4389f1c75ea8</guid>
            <category><![CDATA[email]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Sun, 29 Jan 2017 12:22:18 GMT</pubDate>
            <atom:updated>2017-01-29T12:27:13.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*isA17Y1kcLrpRnfLYNhEvg.png" /><figcaption>Taken from <a href="https://www.google.co.uk/search?q=email+is+shit&amp;rlz=1C5CHFA_enGB722AE722&amp;espv=2&amp;biw=1680&amp;bih=949&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=0ahUKEwjj9vTOrOfRAhUhJ5oKHVGGAZ0Q_AUIBigB#imgrc=VGh0kvRKCJXdJM%3A">Google</a>.</figcaption></figure><p>Email was a modern way of communicating that got old very quick in the modern age. We’re surrounded by push notifications from a shit load of apps that supposedly “bring us together”.</p><p>I use <a href="https://github.com/">GitHub</a> for code. If my team push code, I don’t need an email about it. GitHub has this thing called “notifications” and I read them, <strong>when I want to. </strong><a href="https://slack.com/">Slack</a> has also notifications and I read them, <strong>when I want to.</strong></p><p>Email is very transactional and it makes you think that way too. I’ve seen it hold an invisible layer of shit around people in an office, in many places I’ve worked at over the years. Co-workers stressing about not having “inbox zero”, <strong>no thank you.</strong></p><p>If you have to deal with email, deal with it in your own time and don’t let it dictate how you should work.</p><p>I check emails twice a day, morning and lunchtime 💯. I don’t let email organise my day. I set milestones on <em>[insert project management tool here]</em> for projects and reminders on my iPhone for things I should do. <strong>Emails that want a response go into my reminders too.</strong></p><p>If you’re using Email to communicate internally, then you should look at Slack. <em>You don’t need to be sending emails to check what people are having for lunch or to send a copy of your expenses.</em></p><blockquote><strong>Do yourself a favour, close your email and do some fucking work.</strong></blockquote><p>I’ve been following Ben Orensteins’ “<a href="http://www.benorenstein.com/blog/my-morning-checklist">Morning checklist</a>” for 27 days now and I’m way more productive than I was in 2016. Thanks Ben 👋</p><p><a href="https://www.intercom.com/">Intercom</a> is a great way to communicate with your customers also.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4389f1c75ea8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Friendly OS X defaults]]></title>
            <link>https://medium.com/@notrab/friendly-os-x-defaults-d7f0cc39f2b3?source=rss-1ed0fbea8a55------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7f0cc39f2b3</guid>
            <category><![CDATA[os-x]]></category>
            <category><![CDATA[iterm2]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Jamie Barton]]></dc:creator>
            <pubDate>Mon, 27 Jun 2016 09:28:33 GMT</pubDate>
            <atom:updated>2016-06-27T09:50:02.345Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the years I’ve discovered an array of OS X defaults that make my life easier and performing tasks quicker. One of the reasons I learnt Vim was because I was using my mouse far too much for repetitive tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_n0pNywgow6inZX52REyA.jpeg" /></figure><p>You should know what you’re doing when using the Terminal. <strong>If you use iTerm I imagine you have a pretty good idea.</strong> Don’t blame me when you break something 👊.</p><h3>Developer happiness</h3><h4>Faster keyboard response</h4><pre>defaults write NSGlobalDomain KeyRepeat -int 0.02</pre><h4>Reduced key repeat delay</h4><pre>defaults write NSGlobalDomain InitialKeyRepeat -int 12</pre><h4>UTF-8 Terminal happiness</h4><pre>defaults write com.apple.terminal StringEncodings -array 4</pre><h4>Protect your code</h4><p>This might not be a developer friendly default, but you can keep your code secure when your screensaver starts and you have to leave your hot desk.</p><pre>defaults write com.apple.screensaver askForPassword -int 1</pre><pre>defaults write com.apple.screensaver askForPasswordDelay -int 0</pre><h3>Overall nice-to-haves</h3><p>These aren’t developer specific but really helpful. 💯</p><h4>Silence your boot chime</h4><p>Don’t wake your fiancée when you’re working late. Silence that boot chime.</p><pre>sudo nvram SystemAudioVolume=” “</pre><h4>Increase the Dock show/hide speed</h4><p>If you have to use the Dock, speed up the time it animates in and out.</p><pre>defaults write com.apple.dock autohide -bool true</pre><pre>defaults write com.apple.dock autohide-time-modifier -float 0.5</pre><pre>killall Dock</pre><h4>Save/Print Modals</h4><p>Expanding the Save and Print modals in OS X is a repetitive task and is something you can set to always show if you know how to.</p><pre>defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true</pre><pre>defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true</pre><h4>Return of ~/Library</h4><p>Maybe you’re a frequent visitor of the ~/Library folder. I always forget the ALT shortcut when in Finder to show ~/Library.</p><pre>chflags nohidden ~/Library</pre><h4>Create prettier screenshots in OS X</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nUaKq13jTWHte51qftpsDQ@2x.png" /><figcaption>Shadow vs. No Shadow</figcaption></figure><p>Screenshots come with a shadow effect by default. <strong>You can remove it.</strong></p><pre>defaults write com.apple.screencapture disable-shadow -bool true</pre><h4>Disable Notification Center</h4><p>You can easily disable Notification Center in newer versions of Mac OS, along with removing the icon from the status bar by executing the following.</p><pre>launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist </pre><pre>killall NotificationCenter</pre><h4>‘Are you sure you want to open this application?’</h4><p>Open an application from the web without being asked if that’s what you really want to do.</p><pre>defaults write com.apple.LaunchServices LSQuarantine -bool false</pre><p>Alternatively, you might want to allow apps downloaded from “Anywhere” allowed to be opened.</p><pre>sudo spctl — master-disable</pre><h4>Disable Time Machine annoying dialogs</h4><p>You’ll store your documents and photos in iCloud, your code on GitHub and your music on Spotify. Time Machine doesn’t need to ask you if you want to use any storage devices as a backup drive.</p><pre>defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true</pre><h3>Applying the changes</h3><p>To make any of these work, you’ll need to use <strong>Terminal</strong> and <strong>execute the following command</strong> after to apply the changes. <em>You’ll need to reboot if you selected to get rid of Notifications Center.</em></p><pre>killall Finder</pre><p>If you’ve got any other Mac OS X defaults, please leave a comment or reach out on <a href="https://twitter.com/notrab">Twitter</a>. Have a nice day 👌.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7f0cc39f2b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>