From e69497fab457df486b2a7068bdd0283505461f8b Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Thu, 2 May 2019 11:12:28 +0900 Subject: Types src/settings --- src/settings/reducers/setting.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/settings/reducers') diff --git a/src/settings/reducers/setting.ts b/src/settings/reducers/setting.ts index 54033aa..47c21bf 100644 --- a/src/settings/reducers/setting.ts +++ b/src/settings/reducers/setting.ts @@ -1,13 +1,23 @@ -import actions from 'settings/actions'; +import * as actions from '../actions'; -const defaultState = { +interface State { + source: string; + json: string; + form: any; + error: string; +} + +const defaultState: State = { source: '', json: '', form: null, error: '', }; -export default function reducer(state = defaultState, action = {}) { +export default function reducer( + state = defaultState, + action: actions.SettingAction, +) { switch (action.type) { case actions.SETTING_SET_SETTINGS: return { ...state, -- cgit v1.2.3