<?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 Avery Bloom on Medium]]></title>
        <description><![CDATA[Stories by Avery Bloom on Medium]]></description>
        <link>https://medium.com/@AveryBloom?source=rss-b51312d7fe46------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*47amJVEaIKizBoPs8d54CA.jpeg</url>
            <title>Stories by Avery Bloom on Medium</title>
            <link>https://medium.com/@AveryBloom?source=rss-b51312d7fe46------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 20:28:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@AveryBloom/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[How to speak to an actual person at the IRS as of January 2018]]></title>
            <link>https://medium.com/@AveryBloom/how-to-speak-to-an-actual-person-at-the-irs-as-of-january-2018-a3be773a1feb?source=rss-b51312d7fe46------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3be773a1feb</guid>
            <category><![CDATA[taxes]]></category>
            <category><![CDATA[phone-number]]></category>
            <category><![CDATA[irs]]></category>
            <dc:creator><![CDATA[Avery Bloom]]></dc:creator>
            <pubDate>Tue, 09 Jan 2018 19:09:52 GMT</pubDate>
            <atom:updated>2018-01-09T19:09:52.633Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YAtSReSR_ZJmH3VWS_OD2Q.jpeg" /><figcaption>This is what a phone used to look like before there were emojis.</figcaption></figure><p>Having just spent +/- an eternity trying to get through to the IRS</p><ul><li>800–829–1040 (individual number)</li><li>1 — English</li><li>2 — Forms and history</li><li>1 — I don’t remember</li><li>3 — I don’t remember this one either</li><li>2 — Oof this one either.</li><li>Enter your SSN</li><li>1 — Confirm</li><li>Waaaaaaait</li></ul><p>I’ve actually found folks at the IRS to be extremely helpful (though exhausted). Be nice to them…</p><p>(If you call, comment here and I’ll update with the what the prompts are.)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3be773a1feb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Async or Swim: Replacing your Route models with Ember Concurrency Tasks]]></title>
            <link>https://medium.com/@AveryBloom/async-or-swim-replacing-your-route-models-with-ember-concurrency-tasks-5a230252893a?source=rss-b51312d7fe46------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a230252893a</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[emberjs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ember]]></category>
            <dc:creator><![CDATA[Avery Bloom]]></dc:creator>
            <pubDate>Sat, 23 Dec 2017 01:04:57 GMT</pubDate>
            <atom:updated>2018-02-14T18:23:21.267Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Xvc9AjoBUdWk_DMvXLp74g.png" /></figure><p>The asynchronous nature of Ember.js apps can be a tremendous asset, but it’s always important to let the users know when something is loading so your app doesn’t feel completely broken. Ember has a wide variety of tools to handle this sort of thing, but using promises and displaying a loading state to the user is pretty wonky out of the box. Enter, <a href="http://ember-concurrency.com/">Ember Concurrency</a>. I’m not going to re-hash Ember concurrency’s greatness, just take a look over <a href="https://engineering.linkedin.com/blog/2016/12/ember-concurrency--or--how-i-learned-to-stop-worrying-and-love-t">here</a>, or <a href="https://emberway.io/ember-concurrency-the-solution-to-so-many-problems-you-never-knew-you-had-cce6d7731ba9">over here</a>. Long story short, use it and love it, and revel in the glory of async-iness.</p><p>That being said, the patterns to use Ember Concurrency effectively can take a moment to wrap your head around. Once you’ve fallen in deep deep love with EC, you’re going to want to use them everywhere. One of the core async elements of your Ember app is probably in your model() hooks.</p><p>So how how do you banish promises, and use all that Ember Concurrency goodness in your route’s model hooks?</p><p>We’ll use the classic myBlog example to get us going…</p><h3><strong>The Basic Case</strong></h3><p>Lets say you just need to make a basic call to Ember Data in your model hook to query for today’s blog post. Easy peasy. Just return an object out of your model that includes the object you want to use for your model (in this case “blog”), as well as the task. When the task is complete, the model.blog will be the result of a completed EC task, and you’re good to go.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b672c34a724c7825e5cc7b37cdab57e/href">https://medium.com/media/5b672c34a724c7825e5cc7b37cdab57e/href</a></iframe><p>Cool!</p><h3>The Case of the Dynamic Segment</h3><p>It’s pretty rare to just grab any ol’ thing from the back-end, usually your user is looking for something specific. So what if you have a dynamic segment in your route? Lets imagine someone wants to read a particular blog post of yours.</p><p>Just pass along the id from your model hook’s param argument to your task. In this case we’ll be passing blog_id</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b97af1f1304184535a316b04bc14dcb/href">https://medium.com/media/9b97af1f1304184535a316b04bc14dcb/href</a></iframe><p>Lovely!</p><h3>The Case of the Nested Route</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*XzON-xQS6onemMaaP5WRhA.png" /></figure><p>Proof = pudding: <strong>Here’s an Ember Twiddle showing how it all comes together</strong>:<a href="https://ember-twiddle.com/c21429687f4414d69d93b46d7406ea4e?openFiles=templates.blog.comments.hbs%2C&amp;route=%2Fblog%2F1%2Fcomments"> Ember Concurrency With Model Hooks and Nested Routes</a></p><p>Ok so this is when it gets a little trickier. What do you do about nested routes? Frequently in a nested route, a child route needs the resolved data from the parent. For instance in the case of a blog/1234/comments route.</p><p>When you’re using the model() hook in Ember, one thing that’s nice is that you know that your parent model has finished resolving by the time you get to a child route’s model() hook. If you’re not using Ember Concurrency, you would probably return something like: modelFor(&#39;blog&#39;).get(&#39;comments&#39;) However, the downside is that your users need to wait for everything to load up and dealing with the loading sub-states for deeply nested routes can be really messy.</p><p>So, how do you combine the need to have a resolved parent model in order to load the correct child route’s data, with your groovy Ember Concurrency Task based models?</p><p>Yield modelFor() in your sub-route model task, and then act on that data to grab what you’re actually trying to load:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/edea2585a3d96025f72c68c374778acb/href">https://medium.com/media/edea2585a3d96025f72c68c374778acb/href</a></iframe><p>Tada! Down with the model hook… long live the model hook!</p><h3>Bonus Points</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*3wg0GSEx7ppVFFGN6Yn6Mg.png" /></figure><p>Here are a few things that will upgrade your EC Model shenanigans from a solid yellow belt up to BLUE…</p><h3><strong>+2pts Pass loading and value separately</strong></h3><p>Making sure that all of your templates and components are dealing with your model in its task form can be overkill. If you want to pass around your blog in its resolved form (meaning null when unresolved otherwise the resolved value) then add the following computed properties to your controller. Also, adding a convenience computed for isRunning:</p><pre>blog: reads(&#39;model.blog.value&#39;), // this will be null, then a value<br>isLoading: reads(&#39;model.blog.isRunning&#39;)</pre><h3>+3pts Cancel abandoned model calls</h3><p>What happens if your user doesn’t wait until your model is done loading? Let’s clean up after ourselves by canceling unfinished tasks:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73cadf2194b5a836299410c6e9903e1b/href">https://medium.com/media/73cadf2194b5a836299410c6e9903e1b/href</a></iframe><p>Yep! Just add .cancelOn(&#39;deactivate&#39;) and you’re in the clear.</p><h3>Gotchas #1</h3><p>Directly returning a task in the model hook (not wrapped in a hash) will behave the same way as if you were using regular promises. That’s because the tasks are promise-like, and Ember assumes that if you return something promise-like from your model() hook, it should wait for it to resolve first.</p><pre>// DONT:<br>model(){<br>  return this.get(&#39;blogTask&#39;).perform();<br>}<br>// DO:<br>model(){<br>  return {<br>    blog: this.get(&#39;blogTask&#39;).perform()<br>    };<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a230252893a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>