<?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 Robin Heinze on Medium]]></title>
        <description><![CDATA[Stories by Robin Heinze on Medium]]></description>
        <link>https://medium.com/@robinheinze?source=rss-2d9e1201ef49------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k0An8IhPc2WW8FAz2C15jQ.jpeg</url>
            <title>Stories by Robin Heinze on Medium</title>
            <link>https://medium.com/@robinheinze?source=rss-2d9e1201ef49------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 07:34:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@robinheinze/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[A Day in the Life of a Mom in Tech]]></title>
            <link>https://shift.infinite.red/a-day-in-the-life-of-a-mom-in-tech-8669b98041aa?source=rss-2d9e1201ef49------2</link>
            <guid isPermaLink="false">https://medium.com/p/8669b98041aa</guid>
            <category><![CDATA[working-moms]]></category>
            <category><![CDATA[moms-in-tech]]></category>
            <category><![CDATA[working-parents]]></category>
            <category><![CDATA[remote-working]]></category>
            <dc:creator><![CDATA[Robin Heinze]]></dc:creator>
            <pubDate>Thu, 29 Aug 2019 15:18:37 GMT</pubDate>
            <atom:updated>2019-08-29T15:18:37.492Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzIMNqnUpNkmLyJ5a4C-IQ.jpeg" /><figcaption>My pair programmer deep in thought</figcaption></figure><p>Here at <a href="https://infinite.red/?utm_medium=blog&amp;utm_source=redshift&amp;utm_campaign=mom_tech">Infinite Red</a>, we are very vocal about the <a href="https://shift.infinite.red/7-reasons-were-grateful-for-remote-work-9f9a9e313c68">many perks of remote work</a>. One of the biggest for many of us is extra time with our loved ones since we can work at home.</p><p>After I had my daughter, this manifested as an extra three months after my three-month official maternity leave where I was able to continue working part-time, while also being my baby’s primary caregiver (and food source!). I’m incredibly grateful for this extra precious time with my daughter, and it absolutely would not have been possible without remote work.</p><p>I get a lot of questions about how I juggled both jobs, so here’s a glimpse into a typical day* in the life of a software engineer with a newborn!</p><p><em>*Disclaimer: Anybody who has kids knows there’s no such thing as a typical day with a baby! Every day took whatever shape it needed to meet her needs, so this is more of an average :)</em></p><p><strong>6:00 AM</strong>: Baby is up for the day! I feed her while my husband makes breakfast, and then we head downstairs and play for a bit.</p><p><strong>8:00 AM</strong>: Husband leaves for work, and it’s time for baby’s first nap of the day! After putting her down, I head into the office and get to work. I’m fixing bugs for the <a href="https://github.com/infinitered/ChainReactApp2019">Chain React 2019 app</a>.</p><p><strong>9:45 AM: </strong>Baby wakes up! I feed her, then it’s playtime! I head downstairs with her, and she hangs out on her playmat or jumper. During this time, I respond to a few slack messages on my phone.</p><p><strong>11:00 AM:</strong> We head out for a walk to the park!</p><p><strong>12:00 PM: </strong>Time for nap number two. I grab some leftovers from the fridge for lunch and bring them upstairs (working lunches when time is precious!) and get back into bug fixing.</p><p><strong>12:35 PM: </strong>Baby is awake! Time to feed her again!</p><p><strong>1:00 PM: </strong>Company bi-weekly all-hands meeting on Zoom. Baby hangs out on my lap.</p><p><strong>1:15 PM: </strong>Baby decides she’s bored on my lap and gets fussy, so I move her to the playmat that I have on the floor in my office. She doesn’t like it when I turn my back, so I hop back into the meeting from my phone.</p><p><strong>2:00 PM</strong>: Meeting is over! We decide to run a quick errand to the grocery store.</p><p><strong>3:00 PM: </strong>Time for the last nap of the day! Back into the office to fix more bugs.</p><p><strong>3:45 PM: </strong>Baby wakes up! I’m right in the middle of a thought, so I get her and bring her in to my office, and she sits on my lap while I code until I get to a stopping place (about 5 minutes). Then time for her to eat again!</p><p><strong>5:00 PM</strong>: Husband gets home from work and takes over baby duty. I hop back online for 15–20 minutes.</p><p><strong>5:30 PM: </strong>Dinner!</p><p><strong>7:00 PM</strong>: Baby goes to bed. I hop online for a bit to finish things up.</p><p><strong>7:30 PM</strong>: Sign off for the night and spend time with my husband.</p><p>Some things that made this arrangement possible:</p><ul><li>My bosses (<a href="https://medium.com/u/4a1ccb16af26">Jamon Holmgren,</a> <a href="https://medium.com/u/fd2fbd1d8377">Todd Werth</a> and <a href="https://medium.com/u/6ca0fe37eac1">Gant Laborde</a>) were incredibly supportive and set me up on projects that meshed well with my unpredictable schedule.</li><li>My coworkers were incredibly gracious and understanding of the asynchronous nature of my communication and the fact that I couldn’t always hop into Zoom at a moment’s notice or respond on Slack immediately.</li><li>My husband gave up some of his evening and weekend time with me to be on solo baby duty while I caught up on work.</li></ul><p>I’m now back full time, and we have a wonderful nanny who comes and hangs out with my daughter while I work, but I’m very grateful that I can pop downstairs and see her whenever I want. Remote work is a dream for anybody wanting more time with family without compromising their productivity. If your company is considering remote work, but not quite sure how to make it happen, check out <a href="https://shift.infinite.red/six-ways-to-build-a-strong-remote-company-culture-df0a49b2f549">Six Ways to Build a Strong Remote Company Culture</a> and be sure to read our free eBook: <a href="http://remote.infinite.red/">The Remote Work Handbook</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/75/0*QasM0lHu4FOPWIfm.jpeg" /><figcaption>Robin Heinze</figcaption></figure><p><a href="https://medium.com/@robin_heinze">Robin Heinze</a> is a senior software engineer building React Native apps at <a href="https://infinite.red/?utm_medium=blog&amp;utm_source=redshift&amp;utm_campaign=mom_tech">Infinite Red</a>, a mobile/web app design and development agency. Follow her on <a href="https://twitter.com/robin_heinze">Twitter</a> or <a href="https://github.com/robinheinze">Github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8669b98041aa" width="1" height="1" alt=""><hr><p><a href="https://shift.infinite.red/a-day-in-the-life-of-a-mom-in-tech-8669b98041aa">A Day in the Life of a Mom in Tech</a> was originally published in <a href="https://shift.infinite.red/">Red Shift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Trivia App with Ignite Bowser — Part 2]]></title>
            <link>https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-ii-a286a978d0c8?source=rss-2d9e1201ef49------2</link>
            <guid isPermaLink="false">https://medium.com/p/a286a978d0c8</guid>
            <category><![CDATA[ignite]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[mobx-state-tree]]></category>
            <dc:creator><![CDATA[Robin Heinze]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 17:52:38 GMT</pubDate>
            <atom:updated>2024-01-11T19:18:36.995Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating a Trivia App with Ignite — Part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0595YdQf6XOqEJt35llhLA.png" /></figure><p>UPDATE 1/09/2024: This has now been updated to be compatible with Ignite Exp[ress]o (9.3.1).</p><p>In <a href="https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-1-1987cc6e93a1">Part I</a>, we setup a data model for our Trivia App based on <a href="https://opentdb.com/">Open Trivia DB</a> and built using <a href="https://github.com/infinitered/ignite">Ignite</a>. In Part II, we’re going to hook up some screens to complete the data lifecycle!</p><p>First things first, we need a screen. Let’s generate one:</p><pre>npx ignite-cli g screen Question</pre><p>Now we have a blank screen called QuestionScreen.tsx. Open app/screens/index.ts and remove and WelcomeScreen.</p><p>Let’s remove the current welcome screen that comes with Ignite.</p><ul><li>Open app/screens/index.ts and removeWelcomeScreen.</li><li>Open app/navigators/AppNavigator.tsx to removeWelcome screen in AppStackParamList andAppStack so they look like this:</li></ul><pre>export type AppStackParamList = {<br>  Question: undefined<br>  // IGNITE_GENERATOR_ANCHOR_APP_STACK_PARAM_LIST<br>}</pre><pre>const AppStack = observer(function AppStack() {<br>  return (<br>    &lt;Stack.Navigator screenOptions={{ headerShown: false, navigationBarColor: colors.background }}&gt;<br>      &lt;Stack.Screen name=&quot;Question&quot; component={Screens.QuestionScreen} /&gt;<br>      {/* IGNITE_GENERATOR_ANCHOR_APP_STACK_SCREENS */}<br>    &lt;/Stack.Navigator&gt;<br>  )<br>})</pre><p>Before we run the app, let’s fix up a few things:</p><ul><li>Add an entry in en.ts within the i18n folder for this screen’s text translations:</li></ul><pre>questionScreen: {<br>    title: &quot;Questions&quot;,<br>}</pre><ul><li>In app/theme/colors.ts add darkPlum: &quot;#20162D&quot; to the palette. Then update colors to use background: palette.darkPlum and text: palette.neutral100</li><li>Add our title to QuestionsScreen:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc23050ff485492968a234a7f2264290/href">https://medium.com/media/cc23050ff485492968a234a7f2264290/href</a></iframe><p>When we run the app, it looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mKsGwspASAuZwjaswb3_Q.png" /></figure><h3>Adding Data</h3><p>Our screen looks a little barren, so let’s add some data!</p><p>First, we’ll add our QuestionStore to the app/models/RootStore.ts.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f22b71eaa9430a92bccdec1ddb3f0b7e/href">https://medium.com/media/f22b71eaa9430a92bccdec1ddb3f0b7e/href</a></iframe><p>Now, we can use our questionStore in our screen.</p><pre><br>import { useStores } from &quot;../models&quot;<br><br>...<br><br>export const QuestionScreen: FC&lt;QuestionScreenProps&gt; = observer(<br>  function QuestionScreen() {<br>  <br>    // Pull in one of our MST stores<br>    const { questionStore } = useStores()<br>    <br>...</pre><p>Our generated screen comes with the observer wrapper around the component function, to tell the screen to listen for MST updates, and then we use the useStores hook to bring our store into the body of our component. You can read more about observer and creating a useStores hook in the <a href="https://github.com/mobxjs/mobx-react#which-components-should-be-marked-with-observer">mobx-react documentation</a>.</p><h4>Making a List</h4><p>Now let’s pull our data out of the store and make a list!</p><ul><li>Lets install lodash.shuffle (and Typescript types)</li></ul><pre>yarn add lodash.shuffle @types/lodash.shuffle</pre><ul><li>Add a view called allAnswers to question.ts that makes an array containing all of the answers (incorrect and correct) and then shuffles them using lodash.shuffle. We use this in renderItem to display the answer options in random order.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62d69230303cbf5de5eac41a9163a729/href">https://medium.com/media/62d69230303cbf5de5eac41a9163a729/href</a></iframe><p>Let’s updateQuestionScreen.tsx to fetch questions and render the data from questionStore in a ListView. <a href="https://github.com/infinitered/ignite/blob/master/docs/boilerplate/components/ListView.md">ListView</a> is a component included in Ignite that uses <a href="https://shopify.github.io/flash-list/">FlashList</a> behind the scenes for speedy rendering of large lists.</p><p>We’ll also move our header into ListView’s ListHeaderComponent so it scrolls with the rest of the questions.</p><p>Here is what our screen looks like now:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4e2b84a31f5d4fb990252555495625c/href">https://medium.com/media/e4e2b84a31f5d4fb990252555495625c/href</a></iframe><p>A few things to note here:</p><ul><li>When we pull-to-refresh, we load a new set of questions. A useEffect() hook is added to fetch questions initially.</li><li>We added an extraData prop to our ListView. This a common gotcha in MST. In order for the ListView to know to update when we get new data in our list, we have to explicitly specify a value that we know will change (in our case, the text of the first question).</li><li>We set statusBarStyle=&quot;light&quot; on Screen so the status bar is visible against the dark background</li><li>We added a little decodeHtml.ts helper to utils to decode the question after receiving it from the API, since it comes back still HTML encoded. Here is the code:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46bbd9d05fdc2a627edd3d1e0a322c6f/href">https://medium.com/media/46bbd9d05fdc2a627edd3d1e0a322c6f/href</a></iframe><ul><li>We also created the QuestionComponent then wrapped it with an observer for the ObservedQuestion . This allows us to avoid unneeded re-renders of the QuestionComponent and only re-rendering when the observer detects a change to the data provided to it.</li></ul><p>When we run the app, the screen looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*BQTV-hy0LqoD0L5A.png" /><figcaption>QuestionScreen after providing data from the api.</figcaption></figure><h3>Making It Interactive</h3><p>Great! We have a list of questions now. But trivia isn’t very fun if you can’t answer the questions and see if you were right…</p><p>So let’s make our screen interactive.</p><p>First, we’re going to add a few things to our Question model:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eecaacf3d0e787e0a112a1069e5cfd4b/href">https://medium.com/media/eecaacf3d0e787e0a112a1069e5cfd4b/href</a></iframe><ul><li>A new property called guess, which is an optional string.</li><li>We can’t change the value of properties using self. except from within the model itself, so in order to change guess from our screen, we need a setter action that we’ll call setGuess.</li><li>A computed value (view) called isCorrect that checks the guess against correctAnswer. As long as neither of those values change, the return value of isCorrect will be cached and doesn’t need to be calculated every time it’s called.</li></ul><p>Now we’re finally ready to make our questions interactive:</p><ul><li>Install react-native-radio-buttons-group</li></ul><pre>yarn add react-native-radio-buttons-group</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb3ad210ec20f0e6ff8fc03eba819a9b/href">https://medium.com/media/cb3ad210ec20f0e6ff8fc03eba819a9b/href</a></iframe><p>Here’s what we did:</p><ul><li>We brought in <a href="https://github.com/thakurballary/react-native-radio-buttons-group">react-native-radio-buttons-group</a> to add a radio button selector. The options that we pass to it are from the view we made earlier: questions.allAnswers</li><li>When each radio button item is pressed, we set guess on that question to the text of the selected answer</li><li>When the “Check Answer” button is pressed, we call our isCorrect computed value, and put up an alert telling the user whether they got it right or not.</li></ul><p>Here’s our app in action!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*bqH0rNLqElLqtJmn.gif" /><figcaption>Trivia App in action!</figcaption></figure><p>🎉 And there you have it! A basic Trivia app built with <a href="https://github.com/infinitered/ignite">Ignite</a>, using MobX-State-Tree and TypeScript.</p><p>You can view the complete source code here: <a href="https://github.com/Jpoliachik/ignite-trivia">https://github.com/Jpoliachik/ignite-trivia</a></p><p>Stay tuned to Red Shift for more React Native tips, tricks, and tutorials!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/75/0*_c0aXQs8UnrO6luE.jpeg" /></figure><p><a href="https://shift.infinite.red/u/2d9e1201ef49?source=post_page---------------------------">Robin Heinze</a> is a senior software engineer building React Native apps at <a href="https://infinite.red/?source=post_page---------------------------">Infinite Red,</a> a mobile/web app design and development agency. Follow her on <a href="https://twitter.com/robin_heinze?source=post_page---------------------------">Twitter</a> or <a href="https://github.com/robinheinze?source=post_page---------------------------">Github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a286a978d0c8" width="1" height="1" alt=""><hr><p><a href="https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-ii-a286a978d0c8">Creating a Trivia App with Ignite Bowser — Part 2</a> was originally published in <a href="https://shift.infinite.red/">Red Shift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Trivia App with Ignite Bowser — Part 1]]></title>
            <link>https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-1-1987cc6e93a1?source=rss-2d9e1201ef49------2</link>
            <guid isPermaLink="false">https://medium.com/p/1987cc6e93a1</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mobx-state-tree]]></category>
            <category><![CDATA[ignite]]></category>
            <dc:creator><![CDATA[Robin Heinze]]></dc:creator>
            <pubDate>Wed, 24 Jul 2019 21:09:14 GMT</pubDate>
            <atom:updated>2024-01-11T18:58:28.821Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating a Trivia App with Ignite — Part I</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0595YdQf6XOqEJt35llhLA.png" /></figure><p>UPDATE 1/09/2024: This has now been updated to be compatible with Ignite Exp[ress]o (9.3.1).</p><p>If you’ve never used MobX State Tree or TypeScript, the <a href="https://github.com/infinitered/ignite">Ignite stack</a> can be a bit unfamiliar! If you’re curious why we love this stack, take a look at <a href="https://github.com/infinitered/ignite/blob/master/docs/concept/MobX-State-Tree.md">this doc</a>.</p><p>In this post, we’ll go through the steps of creating the data model for a trivia app to illustrate how to use our stack with real examples.</p><p>(Psst, spoiler alert! If you’d like to follow along with real live code, check out the <a href="https://github.com/Jpoliachik/ignite-trivia">finished app</a>!)</p><p>First things first, let’s Ignite our new app! Check out the <a href="https://github.com/infinitered/ignite">ignite-cli</a> documentation to read up on everything Ignite can do!</p><pre>npx ignite-cli new IgniteTrivia --install-deps --remove-demo</pre><p>As the Ignite commands run you can just accept the the defaults for the remaining prompts:</p><pre>✅ What bundle identifier? · com.ignitetrivia<br>✅ Where do you want to start your project? · /Users/jpoliachik/code/IgniteTrivia<br>✅ Choose a workflow: · Expo Go<br>✅ Do you want to initialize a git repository? (Y/n) · Yes<br>✅ Which package manager do you want to use? · yarn</pre><p>After Ignite finishes running, cd into the folder and run yarn ios or yarn androidand you should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c86LanBSFcKMqImbPiwskg.png" /><figcaption>Ignite Welcome Screen</figcaption></figure><h3>Defining Our Models</h3><p>Next, let’s start building our data models. We’re going to use <a href="https://opentdb.com/">The Open Trivia Database</a> as our data source, so we’ll build our models to match that data.</p><h4>Question</h4><p>We need a question model! Each question has the following properties:</p><p>id, category, type, difficulty, question, correctAnswer, incorrectAnswers</p><p>Let’s create the MobX State Tree (MST) model:</p><pre>npx ignite-cli generate model question</pre><p>This will create two files in our models folder, app/models , which contains a few files:</p><pre>Question.ts<br>Question.test.ts</pre><p>We won’t be writing unit tests quite yet, so we’ll focus on Question.ts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cM_d3-354RCPAoPvDHcu4A.png" /><figcaption>app/models/Question.ts</figcaption></figure><p>This file has a couple different parts. First there’s QuestionModel, which is the heart of this file. It’s the MST model definition. Each model instance has properties, like a regular JS object, but it also has views (computed values), and actions.</p><p>At the bottom of the file, we define some TypeScript interfaces which will help TypeScript to know about the shape of our data as we use it throughout the app.</p><p>We’ll focus on properties first, so let’s add the properties we want each Question to have:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/881d5eab8238d9d0d59e3b0a1ff01647/href">https://medium.com/media/881d5eab8238d9d0d59e3b0a1ff01647/href</a></iframe><p>Let’s unpack this a bit.</p><p>We have id, which is types.identifier. This is MST’s version of a primary key. It has to be unique, and it allows you to do some helpful things like reference your model instance by only its identifier. You can read a bit more about identifiers <a href="https://github.com/mobxjs/mobx-state-tree#identifiers">here</a>.</p><p>Then, we have some string properties: category, question, and correctAnswer. These are all free-form text values, and we’ve made them optional by using types.maybe(). That means these values can be undefined.</p><p>We also have the property incorrectAnswers which is an array of strings. Instead of types.maybe(), we’ve used types.optional(). This allows us to not specify a value for this property, but instead of being undefined, it will take a default value of [].</p><p>Finally, we have typeand difficulty which is are both enumerations. This forces the value to be one of a predetermined list of values, in the case strings.</p><h4>Question Store</h4><p>Since we’ll be listing more than one trivia question, we need a place to store a list of them. So let’s create QuestionStore.</p><pre>npx ignite-cli generate model question-store</pre><blockquote>IGNITE TIP 🎉: If you Ignite apps as often as we do, you can abbreviate generate as g, like npx ignite-cli g model &lt;model-name&gt;</blockquote><p>This file looks a lot like question.ts did when we first generated it, but we’re going to add different properties. For now, it only has one: an array of type QuestionModel. This will be an array of MST instances. We may decide we need more properties later, but this will be enough to get started.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a415f43fb2e70d4bc8d28f3ed94c32a7/href">https://medium.com/media/a415f43fb2e70d4bc8d28f3ed94c32a7/href</a></iframe><h3>Hooking up the API</h3><p>Okay, we have some models describing the shape of data that we want. Now let’s get some data.</p><h4>API Service</h4><p>Ignite comes with an API service all ready to customize, so let’s customize it.</p><p>Changes to config.dev.ts, api.ts and api.types.ts:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbca641c316fdadf9e7a49b901442795/href">https://medium.com/media/fbca641c316fdadf9e7a49b901442795/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14c6bfbbe0362f242f6a2945f449bb8d/href">https://medium.com/media/14c6bfbbe0362f242f6a2945f449bb8d/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3fb1661129d73559e44d0cfe9863391/href">https://medium.com/media/a3fb1661129d73559e44d0cfe9863391/href</a></iframe><p>Here’s what we did:</p><ul><li>We updated the base URL in app/config/config.dev.ts</li><li>Updated the function return types to use QuestionSnapshotOut. <a href="https://github.com/mobxjs/mobx-state-tree#snapshots">Snapshots</a> are the serialized version of MST models, without all the dynamic features like views, and actions. You can think of snapshots as the immutable, plain JS object version of your MST model. This type definition lives in api.types.ts.</li><li>Added a uuid to each record with react-native-uuid. You can add it to your project by running yarn add react-native-uuid.</li></ul><h4>Fetching the Data</h4><p>Now that our API service is setup, let’s tell our models how to call the API and populate data into our store.</p><p>It’s time to make our first MST action.</p><p>But first, let’s take a look at something that comes standard in our generated Question Store Model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a415f43fb2e70d4bc8d28f3ed94c32a7/href">https://medium.com/media/a415f43fb2e70d4bc8d28f3ed94c32a7/href</a></iframe><p>You’ll notice that there’s already an action .actions(withSetPropAction). This is a helper will allow you to set property values directly while retaining type safety and also is executed in an action. This is useful because often you find yourself making a lot of repetitive setter actions that only update one prop.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ae9d882769e4ca1c4efed3983326a07/href">https://medium.com/media/5ae9d882769e4ca1c4efed3983326a07/href</a></iframe><p>We’ve added a new action! getQuestions calls the API method to get the array of snapshots from the API, and then we set the questions prop with the setProp helper function. Because of this helper, we’re able to await for the api.getQuestions call to resolve and set our prop to those results, instead of the <a href="https://mobx-state-tree.js.org/concepts/async-actions#using-generators">mobx-state-tree flow generator function</a> syntax.</p><p>That’s it for Part I! We now have a solid data model, and a way to populate our store from an external API. Next time, in <a href="https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-ii-a286a978d0c8">Part II</a>, we’ll consume our data by hooking up a UI!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/75/0*M4I-gtDDOQgUWU4w.jpeg" /></figure><p><a href="https://shift.infinite.red/u/2d9e1201ef49">Robin Heinze</a> is a senior software engineer building React Native apps at <a href="https://infinite.red/">Infinite Red,</a> a mobile/web app design and development agency. Follow her on <a href="https://twitter.com/robin_heinze">Twitter</a> or <a href="https://github.com/robinheinze">Github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1987cc6e93a1" width="1" height="1" alt=""><hr><p><a href="https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-1-1987cc6e93a1">Creating a Trivia App with Ignite Bowser — Part 1</a> was originally published in <a href="https://shift.infinite.red/">Red Shift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing Ignite Bowser 3.0 — The Flattening]]></title>
            <link>https://shift.infinite.red/announcing-ignite-bowser-3-0-the-flattening-3307d821abf2?source=rss-2d9e1201ef49------2</link>
            <guid isPermaLink="false">https://medium.com/p/3307d821abf2</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[ignite]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[boilerplate]]></category>
            <dc:creator><![CDATA[Robin Heinze]]></dc:creator>
            <pubDate>Tue, 22 Jan 2019 19:55:46 GMT</pubDate>
            <atom:updated>2019-01-22T19:55:46.332Z</atom:updated>
            <content:encoded><![CDATA[<h3>Announcing Ignite Bowser 3.0 — The Flattening</h3><p>We are pleased to announce the release of <a href="https://github.com/infinitered/ignite-bowser">Ignite Bowser</a> 3.0!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*mv0Kgtmeu9SVIqZFt5MN1g@2x.png" /></figure><p>Bowser is the latest and greatest React Native <a href="https://github.com/infinitered/ignite/blob/master/BOILERPLATES.md">boilerplate</a> created by us here at <a href="https://infinite.red/">Infinite Red</a> for our wildly popular app generator, <a href="https://infinite.red/ignite">Ignite CLI</a>. As a successor to our popular <a href="https://github.com/infinitered/ignite-andross">Andross boilerplate</a>, Bowser introduced not only a new stack (MobX State Tree, and Typescript) but also a revamped folder structure.</p><p>However, if you’ve used Bowser, and you felt that folder structure was a bit confusing and hard to follow, you’re not alone.</p><p>Just opening up the main directory, you find src… and then app… and a whole lot of configuration files before finding the actual application code.</p><p>And then once you get to the end of the alphabet and find all of the screens and components under views, things continue to nest, and it can be difficult to find what you’re looking for.</p><p>Then there are domains. What is a domain anyway? Something you buy from GoDaddy? Well yes, but in our case, domains were supposed to be a helpful way of organizing your components and screens into folders related to your application’s business logic. In reality, they are more confusing than helpful and didn’t end up being the universal value-add we had hoped.</p><h3>So what’s new with 3.0?</h3><p>After listening to your feedback about Bowser, and using it ourselves, we’ve decided to flatten out the folder structure, AKA “The Flattening”.</p><ul><li>First of all, there is no more src directory. Everything now lives in app, since that’s what we’re building… an app!</li><li>All components now live under app/components.</li><li>All screens now live under app/screens.</li><li>Generators no longer prompt you to pick a “domain” when generating a new component, screen, or model. We simply place the new item under components, screens, or models.</li><li>We consolidated main.tsx and root-component.tsx into one app.tsx which lives at the root of app.</li><li>We moved setup-root-store.ts into app/models/root-store/</li><li>We also renamed lib to utils because that felt like a more descriptive name.</li></ul><p>Here’s what the new folder structure looks like as a whole:</p><pre>app/<br>  components/<br>    text-field/<br>      index.ts<br>      text-field.tsx<br>      text-field.story.tsx<br>      text-field.props.ts<br>  i18n/<br>  models/<br>    root-store/<br>      setup-root-store.ts<br>  navigation/<br>  screens/<br>    first-example-screen/<br>      first-example-screen.tsx<br>      bowser.png<br>      bowser@2x.png<br>      index.ts<br>  services/<br>    api/<br>    reactotron/<br>  theme/<br>    fonts/<br>    color.ts<br>    spacing.ts<br>    typography.ts<br>    index.ts<br>  utils/<br>    validate.ts<br>    keychain.ts<br>    delay.ts<br>    storage/<br>  app.tsx<br>  environment-variables.ts</pre><p>For a more in-depth look at what’s in each folder, check out the <a href="https://github.com/infinitered/ignite-bowser#quick-start">README</a>.</p><h3>Where can I see an example?</h3><p>Good news! We recently tested this new structure out on the app for our popular React Native conference, <a href="https://infinite.red/ChainReactConf">Chain React</a>.</p><p><a href="https://github.com/infinitered/ChainReactApp2018">infinitered/ChainReactApp2018</a></p><p>And while you’re at it, sign up for the <a href="https://infinite.red/ChainReactConf#thesis-content-chainreact2019-newsletter-heading">Chain React Newsletter</a> because tickets are going on sale <a href="https://infinite.red/ChainReactConf">January 28</a>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*SXR4AG9vQvdMtgtZ-OIbfw.png" /></figure><h3>What’s not changing in 3.0?</h3><p>We aren’t changing everything!</p><ul><li>The stack you love, including MobX State Tree, Typescript, and react-navigation isn’t going anywhere.</li><li>We are continuing the pattern of storing helper files like tests, stories, and image assets right alongside their relevant component, screen, or model. This is in contrast to having separate directories for test files, stories, images, etc.</li></ul><h3>How do I get the update?</h3><p>If you’re about to Ignite a new app, just choose Bowser when asked “Which boilerplate would you like to use?” and you’ll get the latest and greatest!</p><h3>What if I liked the old way better?</h3><p>We know some of you may have been partial to the “domain” way of life. We believe that this new, flatter, structure will serve as a more generic starting point for the majority of people. In fact, we think it will actually make it easier for folks to re-organize and sort their components in ways that make sense to them. So go forth and make folders!</p><p>However, if you’d prefer to keep using the old folder structure and you are Igniting a new app, Ignite CLI 2.2.0 allows you to specify the boilerplate version, so you can run:</p><pre>ignite new FooApp -b ignite-bowser@2.0.3</pre><h3>What does this mean for my existing Bowser app?</h3><p>If you’ve already Ignited an app using the Bowser boilerplate, nothing much will change for you. You may want to pin ignite-bowser to 2.0.3 to avoid any changes to your generators.</p><h3>Acknowledgments</h3><p>Thank you to the team here at <a href="https://infinite.red/">Infinite Red</a> for their hard work on Bowser throughout all of its iterations and for their thoughtful feedback on this restructure.</p><p>Additional thanks for <a href="https://medium.com/u/2f1f37ca2319">Cindy Nguyen</a> for the Bowser graphic!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/75/1*ZMEPtA6tGJ22-piRHpbhIA.jpeg" /><figcaption><a href="https://medium.com/u/2d9e1201ef49">Robin Heinze</a> is a senior software engineer building React Native apps at <a href="https://infinite.red/">Infinite Red,</a> an app design and development agency. Follow her on <a href="https://twitter.com/robin_heinze">Twitter</a> or <a href="https://github.com/robinheinze">Github</a>.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3307d821abf2" width="1" height="1" alt=""><hr><p><a href="https://shift.infinite.red/announcing-ignite-bowser-3-0-the-flattening-3307d821abf2">Announcing Ignite Bowser 3.0 — The Flattening</a> was originally published in <a href="https://shift.infinite.red/">Red Shift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>