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:
		
							
								
								
									
										5
									
								
								reducers/classes.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								reducers/classes.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
export default function classes(state) {
 | 
			
		||||
	if (typeof state === "undefined")
 | 
			
		||||
		return [];
 | 
			
		||||
	return state;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								reducers/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								reducers/index.js
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										14
									
								
								reducers/timetable.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
export default function timetable(state) {
 | 
			
		||||
	if (typeof state === "undefined")
 | 
			
		||||
		// Array of days starting with Sunday
 | 
			
		||||
		return [
 | 
			
		||||
			[],
 | 
			
		||||
			[],
 | 
			
		||||
			[],
 | 
			
		||||
			[],
 | 
			
		||||
			[],
 | 
			
		||||
			[],
 | 
			
		||||
			[],
 | 
			
		||||
		];
 | 
			
		||||
	return state;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user