Skip to content

Instantly share code, notes, and snippets.

@eliot-akira
Created November 22, 2015 23:55
Show Gist options
  • Select an option

  • Save eliot-akira/c979efb6cafcb5dafcb6 to your computer and use it in GitHub Desktop.

Select an option

Save eliot-akira/c979efb6cafcb5dafcb6 to your computer and use it in GitHub Desktop.

Revisions

  1. eliot-akira revised this gist Nov 22, 2015. No changes.
  2. eliot-akira created this gist Nov 22, 2015.
    10 changes: 10 additions & 0 deletions mixof.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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