# Class: Mixin

## coreutils. Mixin

#### new Mixin()

  Static helper class to mix objects

### Methods

#### <static> mergeFunction(dest, source)

  Combine functions in one. Result from source function will be returned and it will be executed first.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `dest` | function | new function
  `source` | function | source function that will be used to return result

  ##### Returns:

  combined function
  Type
    function

#### <static> mix(objects)

  Merges all objects into first object. It will merge functions, properties, getters,setters

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `objects` | object | <repeatable> | to merge

  ##### Returns:

  merged object
  Type
    object

#### <static> mixFunction(parentFunc, childFunc)

  Merges functions if they are not the same and if both params are functions

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `parentFunc` | * | source function
  `childFunc` | * | new function

  ##### Returns:

  merged function
  Type
    *

#### <static> updateParentFunc(parent, child, funcName, newFunc, childFirst)

  Checks if parent has function and merges it with child function if needed

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `parent` | object | parent object
  `child` | object | child object
  `funcName` | string | name of function
  `newFunc` | function | new function
  `childFirst` | boolean | indicates if new function should be called before parent function

  ##### Returns:

  returns self for chaining
  Type
    coreutils.Mixin

#### Search results