dispatchHelper = (type, url, data = {}) => {
  return dispatch =>
    post(`/api/${url}`, data)
      .then(p => dispatch({ type, payload: p.data }))
      .catch(e => console.log(e))
}
Dispatcher helper for dispatching data retrieved from URL

@param {String} type Dispatch type
@param {String} url /api/URL to get data from
@param {Object} data data requested with the url