joeyfigaro
9/17/2016 - 11:22 PM

Example of using redux API middleware

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
	}
});