KevinSmarts 7ed611577f New syntax packages for Atom, Sublime and VS Code from Xorgroth (F95 zone) 6 жил өмнө
..
lib 7ed611577f New syntax packages for Atom, Sublime and VS Code from Xorgroth (F95 zone) 6 жил өмнө
LICENSE.md 7ed611577f New syntax packages for Atom, Sublime and VS Code from Xorgroth (F95 zone) 6 жил өмнө
README.md 7ed611577f New syntax packages for Atom, Sublime and VS Code from Xorgroth (F95 zone) 6 жил өмнө
package.json 7ed611577f New syntax packages for Atom, Sublime and VS Code from Xorgroth (F95 zone) 6 жил өмнө

README.md

Mixto: A simple mixin superclass Build Status

To create a mixin, subclass mixto:

Mixin = require 'mixto'

class MyMixin extends Mixin
  @classMethod: -> console.log("foo")
  instanceMethod: -> console.log("bar")

Then mix into classes with .includeInto:

class MyClass
  MyMixin.includeInto(this)
  
MyClass.classMethod()
(new MyClass).instanceMethod()

Or extend individual objects with .extend:

myObject = {a: 1, b: 2}
MyMixin.extend(myObject)
myObject.instanceMethod()

Or build standalone instances of your 'mixin':

standalone = new MyMixin
standalone.instanceMethod()