Created
June 22, 2012 19:40
-
-
Save oberhamsi/2974675 to your computer and use it in GitHub Desktop.
nicer mixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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