Skip to content

Instantly share code, notes, and snippets.

@hpierre74
Last active June 13, 2021 19:14
Show Gist options
  • Save hpierre74/c3346f5bca1d8977f50d1142b20dc15b to your computer and use it in GitHub Desktop.
Save hpierre74/c3346f5bca1d8977f50d1142b20dc15b to your computer and use it in GitHub Desktop.
export const createUser = ({ username, password }) => async (dispatch, getState) => {
await fetch('/api/user', { method: 'POST', body: JSON.stringify({ username, password }) };
return dispatch({ type: 'CREATED_USER', payload: { username } });
};
export const addUserProfile = profileId => ({ type: 'ADDED_USER_PROFILE', payload: { profileId } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment