initial commit
This commit is contained in:
36
node_modules/mixto/README.md
generated
vendored
Normal file
36
node_modules/mixto/README.md
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Mixto: A simple mixin superclass [](https://travis-ci.org/atom/mixto)
|
||||
|
||||
To create a mixin, subclass mixto:
|
||||
|
||||
```coffee
|
||||
Mixin = require 'mixto'
|
||||
|
||||
class MyMixin extends Mixin
|
||||
@classMethod: -> console.log("foo")
|
||||
instanceMethod: -> console.log("bar")
|
||||
```
|
||||
|
||||
Then mix into classes with `.includeInto`:
|
||||
|
||||
```coffee
|
||||
class MyClass
|
||||
MyMixin.includeInto(this)
|
||||
|
||||
MyClass.classMethod()
|
||||
(new MyClass).instanceMethod()
|
||||
```
|
||||
|
||||
Or extend individual objects with `.extend`:
|
||||
|
||||
```coffee-script
|
||||
myObject = {a: 1, b: 2}
|
||||
MyMixin.extend(myObject)
|
||||
myObject.instanceMethod()
|
||||
```
|
||||
|
||||
Or build standalone instances of your 'mixin':
|
||||
|
||||
```
|
||||
standalone = new MyMixin
|
||||
standalone.instanceMethod()
|
||||
```
|
||||
Reference in New Issue
Block a user