Action Creator Methods
View all action creator method definitions.
Action methods are used to trigger changes in the store. They may fetch requests for data, update existing requests, or receive data and update it in the store.
All actions can be accessed from the actions
object from within a tag, and must be called with dispatch
to trigger the action:
this.actions.functionName(options?);
functionName
is the name of the action methodoptions
are optional additional parameters needed for the action
Example
To fire a new search for a new search term, you can use the following code from within a tag:
this.actions.updateQuery('shoes');
Where the passed in parameter is your intended search term. This will result in an original_query_updated event being fired, which you can listen to using:
this.flux.on('original_query_updated', callback)
In the case that you intend to send an action from outside of a tag, the actions must be accessed from the flux object, and dispatched. From within a tag, the actions object is accessible directly on the tag, dispatches on its own, and should be used in this way, because it will send beaconing data about the tag that triggers the action.
To use actions outside of a tag:
this.flux.store.dispatch(this.flux.actions.functionName(options?));