1 # Mixto: A simple mixin superclass [![Build Status](https://travis-ci.org/atom/mixto.png?branch=master)](https://travis-ci.org/atom/mixto)
3 To create a mixin, subclass mixto:
6 Mixin = require 'mixto'
8 class MyMixin extends Mixin
9 @classMethod: -> console.log("foo")
10 instanceMethod: -> console.log("bar")
13 Then mix into classes with `.includeInto`:
17 MyMixin.includeInto(this)
20 (new MyClass).instanceMethod()
23 Or extend individual objects with `.extend`:
26 myObject = {a: 1, b: 2}
27 MyMixin.extend(myObject)
28 myObject.instanceMethod()
31 Or build standalone instances of your 'mixin':
34 standalone = new MyMixin
35 standalone.instanceMethod()