2018-06-29 15:07:15 +02:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* SettingPage reducer
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { fromJS } from 'immutable';
|
2018-07-03 19:36:01 +02:00
|
|
|
import { ON_CLICK_EDIT_LIST_ITEM } from './constants';
|
2018-06-29 15:07:15 +02:00
|
|
|
|
2018-07-03 19:36:01 +02:00
|
|
|
const initialState = fromJS({
|
2018-07-04 16:49:15 +02:00
|
|
|
listItemToEdit: fromJS({}),
|
2018-07-03 19:36:01 +02:00
|
|
|
indexListItemToEdit: 0,
|
|
|
|
|
});
|
2018-06-29 15:07:15 +02:00
|
|
|
|
|
|
|
|
function settingPageReducer(state = initialState, action) {
|
|
|
|
|
switch (action.type) {
|
2018-07-03 19:36:01 +02:00
|
|
|
case ON_CLICK_EDIT_LIST_ITEM:
|
2018-07-04 16:49:15 +02:00
|
|
|
return state
|
|
|
|
|
.update('listItemToEdit', () => fromJS(action.listItemToEdit));
|
2018-06-29 15:07:15 +02:00
|
|
|
default:
|
|
|
|
|
return state;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default settingPageReducer;
|