⁘ common.helpers

CallList

A CallList is a very simple helper class that stores a list of functions that can be called in registration order, with the ability to empty the list after it has been traversed.

go to → Members

Members

count :number

The number of functions currently registered in the list

Methods

Add(p_fn) → {common.helpers.CallList}

Add a function to the list.
Note that the CallList use a collections.List internally, and as such does not accept duplicate entries.

Parameters:
Name Type Description
p_fn function
Examples:
calllist.Add(foo).Add(bar);

Clear() → {common.helpers.CallList}

Remove all registered functions from the list.

Examples:
//Clear the list after traversing it
calllist.Notify().Clear();

Notify(…args) → {common.helpers.CallList}

Call all the functions in the list in order of addition, with the given args.

Parameters:
Name Type Attributes Description
args any <repeatable>

Remove(p_fn) → {common.helpers.CallList}

Removes a function from the list.

Parameters:
Name Type Description
p_fn function
Examples:
calllist.Remove(foo).Remove(bar);