1
0
mirror of https://gitlab.com/ceda_ei/sonzai.git synced 2025-11-04 09:00:05 +01:00

Add boilerplate for redux, redux-persist.

This commit is contained in:
2020-03-16 07:53:03 +05:30
parent f13caa7cc7
commit b7d68bdf77
7 changed files with 101 additions and 9 deletions

5
reducers/classes.js Normal file
View File

@@ -0,0 +1,5 @@
export default function classes(state) {
if (typeof state === "undefined")
return [];
return state;
}

11
reducers/index.js Normal file
View File

@@ -0,0 +1,11 @@
import { combineReducers } from "redux";
import timetable from "./timetable";
import classes from "./classes";
const rootReducer = combineReducers({
timetable,
classes
});
export default rootReducer;

14
reducers/timetable.js Normal file
View File

@@ -0,0 +1,14 @@
export default function timetable(state) {
if (typeof state === "undefined")
// Array of days starting with Sunday
return [
[],
[],
[],
[],
[],
[],
[],
];
return state;
}