Class: RegisterCallback

@aofl/register-callback~ RegisterCallback

RegisterCallback class. It allows callback functions to be registered and called in series when registerCallbackinstance.next is called.

new RegisterCallback()

Creates an instance of RegisterCallback.
Source:

Methods


next( [err], args)

When next() is invoked, it calls all functions in this.callbacks list and passes error and args to each function.
Parameters:
Name Type Argument Default Description
err Error <optional>
null
args * <repeatable>
Source:

register(cb)

When register() is invoked, it adds next and error functions to the callbacks list.
Parameters:
Name Type Description
cb function The callback function is invoked when registerCallbackInstance.next is called.
Source:
Returns:
Type
function