<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Get A Model From A Backbone Collection Without Knowing If The Collection Is Loaded</title>
	<atom:link href="http://lostechies.com/derickbailey/2012/02/03/get-a-model-from-a-backbone-collection-without-knowing-if-the-collection-is-loaded/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/derickbailey/2012/02/03/get-a-model-from-a-backbone-collection-without-knowing-if-the-collection-is-loaded/</link>
	<description>Better Than Yesterday</description>
	<lastBuildDate>Wed, 19 Jun 2013 18:14:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Johnny Oshika</title>
		<link>http://lostechies.com/derickbailey/2012/02/03/get-a-model-from-a-backbone-collection-without-knowing-if-the-collection-is-loaded/#comment-2194</link>
		<dc:creator>Johnny Oshika</dc:creator>
		<pubDate>Sat, 04 Feb 2012 06:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=799#comment-2194</guid>
		<description>Thanks for this great post, Derrick.  That&#039;s a great technique and I don&#039;t think you&#039;ll run into any race conditions. 

It looks like we&#039;re encountering similar problems building apps with Backbone.

I took a different approach to solve this problem.  I&#039;m using a cache object that manages the fetching and &quot;state&quot; of models and collections.  This cache object exposes something similar to getPersonById and getPeople methods, which immediately return a person model or a people collection whether they&#039;ve been loaded or not.   Inside people or person, there&#039;s a state property that signals to the view the current state of the object, which the view uses to render different things (e.g. loader animation, error message, or the loaded model).  It looks something like this: http://stackoverflow.com/a/8763213/188740

I&#039;m not sure how good this technique is, but it&#039;s been working well for the most recent app that I built.</description>
		<content:encoded><![CDATA[<p>Thanks for this great post, Derrick.  That&#8217;s a great technique and I don&#8217;t think you&#8217;ll run into any race conditions. </p>
<p>It looks like we&#8217;re encountering similar problems building apps with Backbone.</p>
<p>I took a different approach to solve this problem.  I&#8217;m using a cache object that manages the fetching and &#8220;state&#8221; of models and collections.  This cache object exposes something similar to getPersonById and getPeople methods, which immediately return a person model or a people collection whether they&#8217;ve been loaded or not.   Inside people or person, there&#8217;s a state property that signals to the view the current state of the object, which the view uses to render different things (e.g. loader animation, error message, or the loaded model).  It looks something like this: http://stackoverflow.com/a/8763213/188740</p>
<p>I&#8217;m not sure how good this technique is, but it&#8217;s been working well for the most recent app that I built.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
