diff options
| author | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-29 12:10:53 +0500 |
|---|---|---|
| committer | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-29 12:10:53 +0500 |
| commit | 3f41f6994743358a457d4c92625c7412de399658 (patch) | |
| tree | 5900c759e4971477ee5af21761f3887a096086c3 /src/redux/preference | |
| parent | Componentize options form (diff) | |
| download | githunt-3f41f6994743358a457d4c92625c7412de399658.tar.gz | |
Save options functionality
Diffstat (limited to 'src/redux/preference')
| -rw-r--r-- | src/redux/preference/actions.js | 4 | ||||
| -rw-r--r-- | src/redux/preference/reducer.js | 7 | ||||
| -rw-r--r-- | src/redux/preference/types.js | 1 |
3 files changed, 3 insertions, 9 deletions
diff --git a/src/redux/preference/actions.js b/src/redux/preference/actions.js index 57ab13a..54b8259 100644 --- a/src/redux/preference/actions.js +++ b/src/redux/preference/actions.js @@ -1,10 +1,10 @@ import { UPDATE_DATE_TYPE, UPDATE_LANGUAGE, UPDATE_OPTIONS, UPDATE_VIEW_TYPE } from './types'; -export const updateOptions = function (setting) { +export const updateOptions = function (options) { return dispatch => { dispatch({ type: UPDATE_OPTIONS, - payload: setting, + payload: options, }); }; }; diff --git a/src/redux/preference/reducer.js b/src/redux/preference/reducer.js index e634104..089d828 100644 --- a/src/redux/preference/reducer.js +++ b/src/redux/preference/reducer.js @@ -1,4 +1,4 @@ -import { RESET_OPTIONS, UPDATE_DATE_TYPE, UPDATE_LANGUAGE, UPDATE_OPTIONS, UPDATE_VIEW_TYPE } from './types'; +import { UPDATE_DATE_TYPE, UPDATE_LANGUAGE, UPDATE_OPTIONS, UPDATE_VIEW_TYPE } from './types'; const initialState = { viewType: 'grid', @@ -16,11 +16,6 @@ export default function reducer(state = initialState, action) { ...state, options: action.payload }; - case RESET_OPTIONS: - return { - ...state, - options: initialState.options - }; case UPDATE_DATE_TYPE: return { ...state, diff --git a/src/redux/preference/types.js b/src/redux/preference/types.js index e5e52a4..1681e8f 100644 --- a/src/redux/preference/types.js +++ b/src/redux/preference/types.js @@ -1,5 +1,4 @@ export const UPDATE_OPTIONS = 'UPDATE_OPTIONS'; -export const RESET_OPTIONS = 'RESET_OPTIONS'; export const UPDATE_VIEW_TYPE = 'UPDATE_VIEW_TYPE'; export const UPDATE_DATE_TYPE = 'UPDATE_DATE_TYPE'; export const UPDATE_LANGUAGE = 'UPDATE_LANGUAGE'; |
