Skip to content

Instantly share code, notes, and snippets.

@Tinusw
Created April 19, 2018 10:44
Show Gist options
  • Select an option

  • Save Tinusw/a025f907c720a4b0e97358516ccc11bd to your computer and use it in GitHub Desktop.

Select an option

Save Tinusw/a025f907c720a4b0e97358516ccc11bd to your computer and use it in GitHub Desktop.
import { AUTH_USER, AUTH_ERROR } from "../actions/types";
export default function(state = {}, action) {
switch (action.type) {
case AUTH_USER:
return { ...state, error: "", authenticated: true };
case AUTH_ERROR:
return { ...state, error: action.payload.response };
}
return state;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment