Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Something like Mootools Class.Binds would be nice to facilitate proper binding of methods.

#242

When we organize the client side UI into many classes, many instance methods are called from within other functions (like event listeners) and will need an explicit 'bind' to make them work in the correct context.
It will be nice to have something like Mootools 'Binds' - http://mootools.net/docs/more/Class/Class.Binds

Thanks,
Gokul.

Reported by Gokul · May 11th, 2010 @ 03:00 PM

State: resolved
Milestone: 2.0.0 Release
Assigned to: MadRabbit MadRabbit

Activity

  1. MadRabbit
    MadRabbit
    • Tag changed from binding to class, core, feature, implementation

    yes, that's kinda nice feature, will think about it.

    May 11th, 2010 @ 05:21 PM

  2. MadRabbit
    MadRabbit
    • Milestone set to 2.0.0 Release
    • State changed from new to resolved

    I've added the feature, but named it prebind which sounds more correct to me

    var A = new Class({
      prebind: $w('boo hoo'),
    
      boo: function() { 
      },
    
      hoo: function() {
      }
    });
    

    It will go public with the 1.6 release. It also available in master at github

    May 22nd, 2010 @ 12:46 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.