2017-01-17 13:40:59 +01:00
|
|
|
/*
|
|
|
|
* Reducer
|
|
|
|
*
|
|
|
|
* The reducer takes care of our data. Using actions, we can change our
|
|
|
|
* application state.
|
|
|
|
* To add a new action, add it to the switch statement in the reducer function
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* case YOUR_ACTION_CONSTANT:
|
|
|
|
* return state.set('yourStateVariable', true);
|
|
|
|
*/
|
|
|
|
|
2017-01-18 11:59:46 +01:00
|
|
|
import { LOAD_DEFAULT } from './constants';
|
2017-01-17 13:40:59 +01:00
|
|
|
import { fromJS } from 'immutable';
|
|
|
|
|
|
|
|
// The initial state of the App
|
|
|
|
const initialState = fromJS({
|
2017-01-18 11:59:46 +01:00
|
|
|
default: ''
|
2017-01-17 13:40:59 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
function appReducer(state = initialState, action) {
|
|
|
|
switch (action.type) {
|
2017-01-18 11:59:46 +01:00
|
|
|
case LOAD_DEFAULT:
|
2017-01-17 13:40:59 +01:00
|
|
|
return state
|
2017-01-18 11:59:46 +01:00
|
|
|
.set('name', 'Content Manager');
|
2017-01-17 13:40:59 +01:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default appReducer;
|