Skip to content

Instantly share code, notes, and snippets.

@eliot-akira
Created November 22, 2015 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliot-akira/c979efb6cafcb5dafcb6 to your computer and use it in GitHub Desktop.
Save eliot-akira/c979efb6cafcb5dafcb6 to your computer and use it in GitHub Desktop.
Mixin in CoffeeScript
mixOf = (base, mixins...) ->
class Mixed extends base
for mixin in mixins by -1
for name, method of mixin::
Mixed::[name] = method
Mixed
...
class A extends mixOf Foo, Bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment