mirror of https://gitlab.com/ceda_ei/sonzai.git
Fix classes reducer to use {} as default state. Add subjects reducer.
This commit is contained in:
parent
b7d68bdf77
commit
4269b3c3cf
|
@ -1,5 +1,5 @@
|
|||
export default function classes(state) {
|
||||
if (typeof state === "undefined")
|
||||
return [];
|
||||
return {};
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -2,10 +2,12 @@ import { combineReducers } from "redux";
|
|||
|
||||
import timetable from "./timetable";
|
||||
import classes from "./classes";
|
||||
import subjects from "./subjects";
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
timetable,
|
||||
classes
|
||||
classes,
|
||||
subjects,
|
||||
});
|
||||
|
||||
export default rootReducer;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
export default function subjects(state) {
|
||||
if (typeof state === "undefined")
|
||||
return [];
|
||||
return state;
|
||||
}
|
Loading…
Reference in New Issue