MyCrypto/common/reducers/config.js

30 lines
672 B
JavaScript
Raw Normal View History

import {
CONFIG_LANGUAGE_CHANGE,
2017-05-23 23:06:01 +00:00
CONFIG_NODE_CHANGE
} from 'actions/config';
import {languages, nodeList} from '../config/data';
const initialState = {
2017-05-23 23:06:01 +00:00
languageSelection: languages[0],
nodeSelection: nodeList[0]
}
export function config(state = initialState, action) {
switch (action.type) {
case CONFIG_LANGUAGE_CHANGE: {
return {
...state,
2017-05-23 23:06:01 +00:00
languageSelection: action.value
}
}
case CONFIG_NODE_CHANGE: {
return {
...state,
2017-05-23 23:06:01 +00:00
nodeSelection: action.value
}
}
default:
return state
}
}