create-mixin
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "create-mixin", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Creates a mixin for use in a class extends expression", | ||
@@ -26,7 +26,5 @@ "repository": "https://github.com/75lb/create-mixin.git", | ||
"test": "test-runner test.js", | ||
"docs": "jsdoc2md --template README.hbs dist/index.js > README.md", | ||
"dist": "rollup -c dist/index.config.js" | ||
}, | ||
"devDependencies": { | ||
"jsdoc-to-markdown": "^5.0.0", | ||
"rollup": "^1.12.4", | ||
@@ -33,0 +31,0 @@ "test-runner": "^0.6.0" |
@@ -9,4 +9,16 @@ [![view on npm](https://img.shields.io/npm/v/create-mixin.svg)](https://www.npmjs.org/package/create-mixin) | ||
Useful for achieving something resembling multiple-inheritence in Javascript. | ||
```js | ||
const mixInto = require('create-mixin') | ||
const EventEmitter = require('events') | ||
class EmittingArray extends mixInto(EventEmitter)(Array) {} | ||
``` | ||
## Example | ||
Given these two classes. | ||
```js | ||
@@ -66,19 +78,4 @@ class Base { | ||
<a name="module_create-mixin"></a> | ||
## create-mixin | ||
Creates a mixin for use in a class extends expression. | ||
<a name="exp_module_create-mixin--createMixin"></a> | ||
### createMixin(Src) ⇒ <code>function</code> ⏏ | ||
**Kind**: Exported function | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| Src | <code>class</code> | The class containing the behaviour you wish to mix into another class. | | ||
* * * | ||
© 2018-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). | ||
© 2018-19 Lloyd Brookes \<75pound@gmail.com\>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
5374
5
80