6 lessons learned from going to production with React-Redux
Royi Schwartz
18011

Embracing async functions (since you’re using webpack, adding babel is pretty simple, there are options to target modern browsers as well, which requires two build targets and production, but saves some size…

export const purchaseTickets = (options) => async (dispatch, getState) => {
const tickets = getState().ticketsReducer.tickets;
const response = await AppUtils.purchaseTickets(tickets);
dispatch(ticketsPurchased(response);
}

Which is even smaller and easier to follow along with. Async functions (and async fat-arrow expressions) return a promise, and internally work similar to co, or Bluebird.coroutine.

You can also do multiple parallel requests with array destructuring combined with Promise.all.

const [result1, result2] = await Promise.all([
doSomethingPromised1(),
doSomethingPromised2()
]);