WikiEducationFoundation/WikiEduDashboard

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

Summary

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

export default function persistedCourse(state = {}, action) {
  switch (action.type) {
    case RECEIVE_COURSE:
    case PERSISTED_COURSE:
      return { ...action.data.course };
    default:
      return state;
  }
}