<?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: Evented programming patterns: Round-up</title>
	<atom:link href="http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/</link>
	<description>This dirt was a building before</description>
	<lastBuildDate>Sat, 28 Aug 2010 16:24:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: James Coglan</title>
		<link>http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/comment-page-1/#comment-4281</link>
		<dc:creator>James Coglan</dc:creator>
		<pubDate>Thu, 04 Mar 2010 00:44:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=623#comment-4281</guid>
		<description>Thanks for the correction, Brent. I&#039;ve updated the article to reflect your suggestion. I usually use &lt;tt&gt;Array#forEach&lt;/tt&gt; which stops such problems from happening, but thought I should use JavaScript common to all browsers for these examples. A good illustration of how useful closures can be!</description>
		<content:encoded><![CDATA[<p>Thanks for the correction, Brent. I&#8217;ve updated the article to reflect your suggestion. I usually use <tt>Array#forEach</tt> which stops such problems from happening, but thought I should use JavaScript common to all browsers for these examples. A good illustration of how useful closures can be!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent Lintner</title>
		<link>http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/comment-page-1/#comment-4278</link>
		<dc:creator>Brent Lintner</dc:creator>
		<pubDate>Wed, 03 Mar 2010 20:33:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=623#comment-4278</guid>
		<description>Great set of posts! 

One thing I wanted to mention was that using your recommended approach of setTimeout(func, 0); does not work properly.

The &#039;i&#039; variable gets closured properly but in the context of setTimeout function, it is still being changed by the for loop. So essentially all the callbacks throw errors as &#039;i&#039; is still changing and will most likely be equal to listeners.length.

We remedied this by wrapping the setTimeout function argument in its own auto invoked function as declared below.

&lt;pre&gt;&lt;code&gt;    setTimeout(function(x){
        return(function(){
            // code here using x
        });
    }(i), 0);&lt;/code&gt;&lt;/pre&gt;

Cheers,

Brent.</description>
		<content:encoded><![CDATA[<p>Great set of posts! </p>
<p>One thing I wanted to mention was that using your recommended approach of setTimeout(func, 0); does not work properly.</p>
<p>The &#8216;i&#8217; variable gets closured properly but in the context of setTimeout function, it is still being changed by the for loop. So essentially all the callbacks throw errors as &#8216;i&#8217; is still changing and will most likely be equal to listeners.length.</p>
<p>We remedied this by wrapping the setTimeout function argument in its own auto invoked function as declared below.</p>
<pre><code>    setTimeout(function(x){
        return(function(){
            // code here using x
        });
    }(i), 0);</code></pre>
<p>Cheers,</p>
<p>Brent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Какво ново в последната седмица на Февуари &#124; NeXt</title>
		<link>http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/comment-page-1/#comment-4261</link>
		<dc:creator>Какво ново в последната седмица на Февуари &#124; NeXt</dc:creator>
		<pubDate>Sun, 28 Feb 2010 12:51:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=623#comment-4261</guid>
		<description>[...] Evented programming patterns: Round-up: Всъщност това е серия от пет много добри постове. [...]</description>
		<content:encoded><![CDATA[<p>[...] Evented programming patterns: Round-up: Всъщност това е серия от пет много добри постове. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
