MyCrypto/common/actions/config.js

48 lines
875 B
JavaScript
Raw Normal View History

2017-04-24 23:59:28 +00:00
// @flow
/*** Change Language ***/
2017-07-04 01:25:01 +00:00
export type ChangeLanguageAction = {
2017-07-04 03:21:19 +00:00
type: 'CONFIG_LANGUAGE_CHANGE',
value: string
2017-07-04 01:25:01 +00:00
};
export function changeLanguage(sign: string): ChangeLanguageAction {
2017-07-04 03:21:19 +00:00
return {
type: 'CONFIG_LANGUAGE_CHANGE',
value: sign
};
2017-07-04 01:25:01 +00:00
}
/*** Change Node ***/
export type ChangeNodeAction = {
type: 'CONFIG_NODE_CHANGE',
// FIXME $keyof?
value: string
};
2017-07-04 01:25:01 +00:00
export function changeNode(value: string): ChangeNodeAction {
2017-07-04 03:21:19 +00:00
return {
type: 'CONFIG_NODE_CHANGE',
value
};
2017-07-04 01:25:01 +00:00
}
/*** Change gas price ***/
export type ChangeGasPriceAction = {
type: 'CONFIG_GAS_PRICE',
value: number
};
export function changeGasPrice(value: number): ChangeGasPriceAction {
return {
type: 'CONFIG_GAS_PRICE',
value
};
}
/*** Union Type ***/
export type ConfigAction =
| ChangeNodeAction
| ChangeLanguageAction
| ChangeGasPriceAction;