More on routing
This commit is contained in:
22
js/reducer.js
Normal file
22
js/reducer.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { NAVIGATE } from './actions';
|
||||
|
||||
const initialState = {
|
||||
pageName: 'index',
|
||||
items: [],
|
||||
releases: [],
|
||||
};
|
||||
|
||||
const appReducer = (state = initialState, action = {}) => {
|
||||
switch (action.type) {
|
||||
case NAVIGATE:
|
||||
return {
|
||||
...state,
|
||||
pageName: action.pageName,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
export default appReducer;
|
||||
Reference in New Issue
Block a user