Skip to content
Haz edited this page Apr 1, 2017 · 14 revisions

Actions are plain objects dispatched by the application (usually from containers) to describe changes on the store. Reducers and sagas listen to it so they can perform state changes and side effects, respectively, within the store.

A simple action would look like:

{ type: 'RESOURCE_UPDATE', id: 1, title: 'Hi!' }

ARc uses action types and action creators to create those action objects:

const RESOURCE_UPDATE = 'RESOURCE_UPDATE'

const resourceUpdate = body => ({
  type: RESOURCE_UPDATE,
  ...body,
})

That way, other parts of the app, usually containers, can dispatch that action:

Clone this wiki locally