scinote-web/app/javascript/packs/shared/reducers/UsersReducer.js

12 lines
270 B
JavaScript
Raw Normal View History

2017-08-09 21:21:02 +08:00
import { SET_CURRENT_USER } from "../../app/action_types";
2017-08-09 15:08:13 +08:00
export function currentUser(
state = { id: 0, fullName: "", avatarPath: "" },
action
) {
if (action.type === SET_CURRENT_USER) {
return Object.assign({}, state, action.payload);
}
return state;
}