< Back to /snippets

Redux Action Creator

Shorthand convenience function for building Redux actions with a structure based on Flux Standard Actions.

const actionCreator = (
  type,
  payload,
  error = false,
) => ({
  type,
  payload,
  error,
});