ecm

es6-class-mixin

Tiny tool to add mixins for ES6 classes.

Showing:

Popularity

Downloads/wk

309

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Mixin for ES6 classes

Build Status

Mixins for ES6 Classes. Based on @mattmccray's gist

Install

npm i -S es6-class-mixin

API

mixin extends given class by object with functions or properties.

mixin(ParentClass, ...mixins) // return new MixedClass extended by Mixins

Examples

// Basic
const mixin = require('es6-class-mixin');

class ListItem {};

let draggable = {
  drag() { /* … */ }
};

let droppable = {
  drop() { /* … */ }
};

class DraggableItem extends mixin(ListItem, draggable, droppable) {}
// Backbone
class Input extends mixin(Backbone.View, Dispatcher.mixin) {}

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial