API Docs for: 0.2.2
Show:

R.Dispatcher Class

Defined in: src\R.Dispatcher.js:5

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

Methods

addActionListener

(
  • action
  • fn
)
Dispatcher.ActionListener

Register an async action listener

Parameters:

  • action Object

    The action name

  • fn Function

    The function to execute when the listener will be notified

Returns:

Dispatcher.ActionListener:

actionListener The created actionListener

createDispatcher

(
  • specs
)
DispatcherInstance

Initializes the dispatcher according to the specifications provided

Parameters:

  • specs Object

    The 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 Action

    The action name of the listener

  • params Object

    The 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 Object

    The action name

Properties

String private

String private