From e1dac618a8b8929f601c7ec8aca3842c5ebf9d03 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 13 Apr 2020 20:37:36 +0900 Subject: Use plugin:prettier/recommended --- src/settings/reducers/setting.ts | 64 ++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 29 deletions(-) (limited to 'src/settings/reducers/setting.ts') diff --git a/src/settings/reducers/setting.ts b/src/settings/reducers/setting.ts index 804853f..31544bb 100644 --- a/src/settings/reducers/setting.ts +++ b/src/settings/reducers/setting.ts @@ -1,8 +1,10 @@ -import * as actions from '../actions'; +import * as actions from "../actions"; import { - JSONTextSettings, FormSettings, SettingSource, -} from '../../shared/SettingData'; -import { DefaultSetting } from '../../shared/settings/Settings'; + JSONTextSettings, + FormSettings, + SettingSource, +} from "../../shared/SettingData"; +import { DefaultSetting } from "../../shared/settings/Settings"; export interface State { source: SettingSource; @@ -13,37 +15,41 @@ export interface State { const defaultState: State = { source: SettingSource.JSON, - json: JSONTextSettings.fromText(''), + json: JSONTextSettings.fromText(""), form: FormSettings.fromSettings(DefaultSetting), - error: '', + error: "", }; export default function reducer( state = defaultState, - action: actions.SettingAction, + action: actions.SettingAction ): State { 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: SettingSource.Form, - form: action.form, }; - case actions.SETTING_SWITCH_TO_JSON: - return { ...state, - error: '', - source: SettingSource.JSON, - json: action.json, }; - default: - return state; + 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: SettingSource.Form, + form: action.form, + }; + case actions.SETTING_SWITCH_TO_JSON: + return { + ...state, + error: "", + source: SettingSource.JSON, + json: action.json, + }; + default: + return state; } } -- cgit v1.2.3