Home Reference Source Test
public class | source

Dispatcher

Class to manage Flux actions flow.

Constructor Summary

Public Constructor
public

Creates a new Dispatcher instance.

Member Summary

Public Members
public
public
public

Method Summary

Public Methods
public

dispatch(payload: Object)

Dispatches an action, triggering the registered callbacks.

public

flush()

Triggers the registered callbacks for all queued actions.

public

register(callback: Function, context: Object, trace: Error): Function

Registers a callback to be executed at every action.

public

Removes the given callback from the registry.

Public Constructors

public constructor source

Creates a new Dispatcher instance.

Public Members

public callbacks: * source

public flushing: boolean source

public payloads: * source

Public Methods

public dispatch(payload: Object) source

Dispatches an action, triggering the registered callbacks.

Params:

NameTypeAttributeDescription
payload Object

public flush() source

Triggers the registered callbacks for all queued actions.

public register(callback: Function, context: Object, trace: Error): Function source

Registers a callback to be executed at every action.

Params:

NameTypeAttributeDescription
callback Function

to be registered

context Object

this variable for the callback

trace Error

error

Return:

Function

added callback

public unregister(callback: Function): Boolean source

Removes the given callback from the registry.

Params:

NameTypeAttributeDescription
callback Function

to be removed

Return:

Boolean

unregistered true if the callback was found