Skip to content

Instantly share code, notes, and snippets.

Ken Carpenter mindjuice

Block or report user

Report or block mindjuice

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mindjuice / authActions.js
Last active May 19, 2016
Simple HTTP requests code using promises. Integrates nicely with Redux actions when using redux-thunk middleware. `httpRequests.js` has the `get`, `put`, `post` and `del` functions and `authActions.js` gives examples of calling `post()` and `get()`.
View authActions.js
import { get, post } from '../../../utils/httpRequests';
export const AUTH_LOGIN = 'AUTH_LOGIN';
export const AUTH_LOGOUT = 'AUTH_LOGOUT';
export const login = (email, password) => {
const params = { username: email, password };
return dispatch => post('/api/login', AUTH_LOGIN, params, dispatch);
You can’t perform that action at this time.