The race condition is already handled by that method. See destroyed-event:
error.


On Wed, May 1, 2013 at 9:44 AM, Ryan Eastridge <notifications@github.com>wrote:

> In src/util.js:
>
> >        });
> >      } else {
> > -      target.push([eventName, callback, context]);
> > +      if (listenTo) {
> > +        target.listenTo(target[listenTo], eventName, getEventCallback(callback, target), context);
> > +      } else {
> > +        target.push([eventName, callback, context]);
> > +      }
>
> Common code path I know how to refactor to, can you tell me how to account
> for the destroy race condition?
> … <#13e608d0ec4c7ef2_>
> On Wed, May 1, 2013 at 8:04 AM, Kevin Decker <notifications@github.com>wrote:
> In src/util.js: > }); > } else { > - target.push([eventName, callback,
> context]); > + if (listenTo) { > + target.listenTo(target[listenTo],
> eventName, getEventCallback(callback, target), context); > + } else { > +
> target.push([eventName, callback, context]); > + } We should refactor
> bindEvents so we have a common codepath for this. The explicit register
> cases here aren't accounting for the destroy "race" condition and the
> normal DRY argument. — Reply to this email directly or view it on GitHub<
> https://github.com/walmartlabs/thorax/pull/151/files#r4036723> .
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/walmartlabs/thorax/pull/151/files#r4037447>
> .
>