Example of using redux API middleware
export const authenticate = (credentials) => ({ type: 'CALL_API', [CALL_API]: { types: [AUTH_REQUEST, AUTH_SUCCESS, AUTH_FAILURE], endpoint: 'auth/login', method: 'POST', data: credentials } });