Redux Actions

//people dropping off a form (Action Creators)
const createPolicy = (name, amount) => {
  return {
   //Action a form in our analogy
    type: 'CREATE_POLICY',
    payload: {
      name: name,
      amount: amount
    }
  }
}


//can  be refactored into:
const createPolicy = (name, amount) => {
  return {
   //Action a form in our analogy
    type: 'CREATE_POLICY',
    payload: {
      name, amount
    }
  }
}

Add your comment