Home Reference Source Repository

Function

Static Public Summary
public

reduceInheritanceChain(constr: Function, reducer: Reducer, carry: *, stop: Function): *

takes a class and reduces its prototype chain with a given callback

public

reducePrototypeChain(instance: Object, reducer: Reducer, carry: *, stop: Function): *

takes an object and reduces its prototype chain with a given callback

Static Public

public reduceInheritanceChain(constr: Function, reducer: Reducer, carry: *, stop: Function): * source

import {reduceInheritanceChain} from 'reduce-prototype/src/reducePrototypeChain.js'

takes a class and reduces its prototype chain with a given callback

Params:

NameTypeAttributeDescription
constr Function

constructor function of class

reducer Reducer

function

carry *

to be reduced into

stop Function

constructor to break reducer

Return:

*

public reducePrototypeChain(instance: Object, reducer: Reducer, carry: *, stop: Function): * source

import {reducePrototypeChain} from 'reduce-prototype/src/reducePrototypeChain.js'

takes an object and reduces its prototype chain with a given callback

Params:

NameTypeAttributeDescription
instance Object

to be reduced

reducer Reducer

function

carry *

to be reduced into

stop Function

constructor to break reducer

Return:

*