WikiEducationFoundation/WikiEduDashboard

View on GitHub
app/assets/javascripts/reducers/user_profile.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { RECEIVE_USER_PROFILE_STATS } from '../constants';

const initialState = {
  stats: {},
  isLoading: true
};

export default function userProfile(state = initialState, action) {
  switch (action.type) {
    case RECEIVE_USER_PROFILE_STATS:
      return {
        stats: action.data,
        isLoading: false
      };
    default:
      return state;
  }
}