scinote-web/app/javascript/packs/shared/reducers/UsersReducer.js
2017-08-09 09:08:13 +02:00

12 lines
264 B
JavaScript

import { SET_CURRENT_USER } from "../actions/types";
export function currentUser(
state = { id: 0, fullName: "", avatarPath: "" },
action
) {
if (action.type === SET_CURRENT_USER) {
return Object.assign({}, state, action.payload);
}
return state;
}