create-mixin
Useful for achieving something resembling multiple-inheritence in Javascript.
const mixInto = const EventEmitter = EventEmitterArray {}
Example
Given these two classes.
{ thisranBaseConstructor = true } { return 1 } { thisranMixinConstructor = true } { return 2 }
Create a new class mixing one class into another.
> const mixInto = > MixinBase {}
Behaviour of new class.
> const something = > /* new class has methods of both source classes */> something1 > something2 > /* Only the base constructor is run */> somethingranBaseConstructortrue > somethingranMixinConstructorundefined > something instanceof Basetrue > something instanceof Mixinfalse
© 2018-19 Lloyd Brookes <75pound@gmail.com>.