Navigation Menu

Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

Add mixins #5

Open
rowanmanning opened this issue Feb 4, 2013 · 3 comments
Open

Add mixins #5

rowanmanning opened this issue Feb 4, 2013 · 3 comments

Comments

@rowanmanning
Copy link
Owner

Allow for mixing in methods from another class after class definition. E.g.

var MyClass = Class.extend({});

// Mix in a set of functions
MyClass.mixin({
    foo: function () {},
    bar: function () {}
});

// Mix in all prototype methods of another class
MyClass.mixin(MyOtherClass);

// Mix in only certain methods of another class
MyClass.mixin(MyOtherClass, ['baz', 'qux']);
@darkguy2008
Copy link

I second this. I wonder if it's possible to do it?

@rowanmanning
Copy link
Owner Author

Definitely possible, just a bit of a rewrite to the library. I'd probably do this as part of a 2.0 release (not planned at the moment, but maybe soon).

@darkguy2008
Copy link

Awesome, looking forward to it! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants