Home Reference Source Test Repository
import {Mixin} from 'es6-mixin/src/lib/index.js'
public class | source

Mixin

Generic mixin superclass. This class is intended to be extended by actual mixins.

Test:

Static Method Summary

Static Public Methods
public static

mixin(target: object, MixedIn: function, args: ...*): object

Mixes in this class's methods into an existing object.

Static Public Methods

public static mixin(target: object, MixedIn: function, args: ...*): object source

Mixes in this class's methods into an existing object.

Params:

NameTypeAttributeDescription
target object
  • optional
  • default: {}

Any object to mix this class's methods into

MixedIn function
  • optional
  • default: this

Constructor to be mixed in

args ...*
  • optional

Arguments to pass to the mixed in constructor, if any

Return:

object

The original target object, mutated

Test: