Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
Created June 22, 2012 19:40
Show Gist options
  • Select an option

  • Save oberhamsi/2974675 to your computer and use it in GitHub Desktop.

Select an option

Save oberhamsi/2974675 to your computer and use it in GitHub Desktop.
nicer mixin
// I never remember which one is the mixin and which one is the class.
// And I find `mixin({mixin:..})` too verbose
mixin(fooMixin, fooBar)
// what I rather want:
mix(fooMixin).into(fooBar);
// so...
var mix = function(mixin) {
return {
into: function (class) {
objects.mixin(mixin, class);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment