Home Reference Source
import {LinkedFuncList} from 'linkedfunclist/src/main.js'
public class | source

LinkedFuncList

A class of linked lists that contain function data.

Constructor Summary

Public Constructor
public

Create a new LinkedFuncList instance.

Member Summary

Public Members
public get
public get

The function data for this list node.

public set
public get

The number of nodes in this list, including this instance.

public get

The next node in the list.

public set
Private Members
private

_func: *

private

_next: *

Method Summary

Public Methods
public

async callAll(start: object): Promise

call all of the list's functions with start value.

public

async chainCall(start: object, end: Function): Promise

call this list's functions mutating a start value through nodes' functions until done.

public

adds some links to this list

Public Constructors

public constructor() source

Create a new LinkedFuncList instance.

Public Members

public get [Symbol.iterator]: GeneratorFunction source

public get func: null | function source

The function data for this list node.

public set func: null | function source

public get length: number source

The number of nodes in this list, including this instance.

public get next: null | LinkedFuncList source

The next node in the list.

public set next: null | LinkedFuncList source

Private Members

private _func: * source

private _next: * source

Public Methods

public async callAll(start: object): Promise source

call all of the list's functions with start value.

Params:

NameTypeAttributeDescription
start object
  • optional

any start value

Return:

Promise

resolves to Array or Error

public async chainCall(start: object, end: Function): Promise source

call this list's functions mutating a start value through nodes' functions until done.

Params:

NameTypeAttributeDescription
start object
  • optional

any start value

end Function
  • optional
  • nullable: true

called at end with mutated start value if a Function, ignored otherwise

Return:

Promise

resolves to single value or Error

adds some links to this list

parses each link:

  • if link isnt already a LinkedFuncList instance, make a new one.
  • if link is a function, the new instance contains that function.
  • if link isn't a function, the new instance contains a function that returns link.

Params:

NameTypeAttributeDescription
links function | LinkedFuncList | object
  • optional

the links to add