From c60d0e7392fc708e961614d6b756a045de74f458 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 30 Apr 2019 14:00:07 +0900 Subject: Rename .js/.jsx to .ts/.tsx --- src/settings/reducers/setting.js | 35 ----------------------------------- src/settings/reducers/setting.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 src/settings/reducers/setting.js create mode 100644 src/settings/reducers/setting.ts (limited to 'src/settings/reducers') diff --git a/src/settings/reducers/setting.js b/src/settings/reducers/setting.js deleted file mode 100644 index 54033aa..0000000 --- a/src/settings/reducers/setting.js +++ /dev/null @@ -1,35 +0,0 @@ -import actions from 'settings/actions'; - -const defaultState = { - source: '', - json: '', - form: null, - error: '', -}; - -export default function reducer(state = defaultState, action = {}) { - switch (action.type) { - case actions.SETTING_SET_SETTINGS: - return { ...state, - source: action.source, - json: action.json, - form: action.form, - error: '', }; - case actions.SETTING_SHOW_ERROR: - return { ...state, - error: action.error, - json: action.json, }; - case actions.SETTING_SWITCH_TO_FORM: - return { ...state, - error: '', - source: 'form', - form: action.form, }; - case actions.SETTING_SWITCH_TO_JSON: - return { ...state, - error: '', - source: 'json', - json: action.json, }; - default: - return state; - } -} diff --git a/src/settings/reducers/setting.ts b/src/settings/reducers/setting.ts new file mode 100644 index 0000000..54033aa --- /dev/null +++ b/src/settings/reducers/setting.ts @@ -0,0 +1,35 @@ +import actions from 'settings/actions'; + +const defaultState = { + source: '', + json: '', + form: null, + error: '', +}; + +export default function reducer(state = defaultState, action = {}) { + switch (action.type) { + case actions.SETTING_SET_SETTINGS: + return { ...state, + source: action.source, + json: action.json, + form: action.form, + error: '', }; + case actions.SETTING_SHOW_ERROR: + return { ...state, + error: action.error, + json: action.json, }; + case actions.SETTING_SWITCH_TO_FORM: + return { ...state, + error: '', + source: 'form', + form: action.form, }; + case actions.SETTING_SWITCH_TO_JSON: + return { ...state, + error: '', + source: 'json', + json: action.json, }; + default: + return state; + } +} -- cgit v1.2.3