Types src/settings

This commit is contained in:
Shin'ya Ueoka 2019-05-02 11:12:28 +09:00
parent c059bf8be3
commit e69497fab4
12 changed files with 194 additions and 117 deletions

View file

@ -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,