Oh, so it is. Those crazy bind statements appearing later! :)


On Wed, Feb 19, 2014 at 12:37 AM, Will <notifications@github.com> wrote:

> In spec/helper/friend.js:
>
> > @@ -2,19 +2,19 @@ var channels = [];
> >  var core = freedom.core();
> >
> >  freedom.on('message', function(msg) {
> > -	if(msg.cmd === 'create') {
> > -		core.bindChannel(msg.chan).done(function(id, chan) {
> > -			console.log('channel resolved: ' + id);
> > -			channels[id] = chan;
> > -			chan.on('message', handler.bind({}, id, chan));
> > -		}.bind(this, msg.id));
> > -	} else if (msg.cmd === 'destroy') {
> > -		delete channels[msg.id];
> > -	}
> > +  if(msg.cmd === 'create') {
> > +    core.bindChannel(msg.chan).then(function(id, chan) {
>
> The id is bound in the anonymous function, only the chan is getting passed
> in.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/UWNetworksLab/freedom/pull/45/files#r9854761>
> .
>



-- 
Lucas Dixon | Google Ideas