R.Dispatcher Class
R.Dispatcher acts as a layer between Store/EventEmitters and components. A React component may submit an action to a dispatcher (such as a click event) and perform updates required.
- Dispatcher.createDispatcher => initialize methods according to the specifications provided
- Dispatcher.addActionListener => add an action listener
- Dispatcher.removeActionListener => remove an action listener
- Dispatcher.dispatch => dispatches an action submitted by a React component
- Dispatcher.destroy => remove all listener previously added
Item Index
Methods
addActionListener
(
Dispatcher.ActionListener
-
action
-
fn
Register an async action listener
Parameters:
-
action
ObjectThe action name
-
fn
FunctionThe function to execute when the listener will be notified
Returns:
Dispatcher.ActionListener:
actionListener The created actionListener
createDispatcher
(
DispatcherInstance
-
specs
Initializes the dispatcher according to the specifications provided
Parameters:
-
specs
ObjectThe specifications
Returns:
DispatcherInstance:
DispatcherInstance The created dispatcher instance
destroy
()
Remove all listener previously added
dispatch
(
-
action
-
params
Dispatches an action submitted by a React component
Parameters:
-
action
ActionThe action name of the listener
-
params
ObjectThe specifics params necessary for an action
Returns:
:
- the data that may be provided by the listener function
removeActionListener
(
-
actionListener
Remove the previously added action listener
Parameters:
-
actionListener
ObjectThe action name