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
View File
@@ -0,0 +1,5 @@
export default function classes(state) {
if (typeof state === "undefined")
return [];
return state;
}
+11
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
View File
@@ -0,0 +1,14 @@
export default function timetable(state) {
if (typeof state === "undefined")
// Array of days starting with Sunday
return [
[],
[],
[],
[],
[],
[],
[],
];
return state;
}