2017-04-24 23:59:28 +00:00
|
|
|
// @flow
|
2017-04-14 06:17:22 +00:00
|
|
|
|
2017-07-27 17:05:09 +00:00
|
|
|
/*** 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
|
|
|
};
|
|
|
|
|
2017-07-27 17:05:09 +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
|
|
|
}
|
2017-04-14 06:17:22 +00:00
|
|
|
|
2017-07-27 17:05:09 +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
|
|
|
}
|
2017-07-20 17:06:10 +00:00
|
|
|
|
2017-07-27 17:05:09 +00:00
|
|
|
/*** Change gas price ***/
|
|
|
|
export type ChangeGasPriceAction = {
|
|
|
|
type: 'CONFIG_GAS_PRICE',
|
|
|
|
value: number
|
|
|
|
};
|
|
|
|
|
2017-07-20 17:06:10 +00:00
|
|
|
export function changeGasPrice(value: number): ChangeGasPriceAction {
|
|
|
|
return {
|
|
|
|
type: 'CONFIG_GAS_PRICE',
|
|
|
|
value
|
2017-07-27 17:05:09 +00:00
|
|
|
};
|
2017-07-20 17:06:10 +00:00
|
|
|
}
|
|
|
|
|
2017-07-27 17:05:09 +00:00
|
|
|
/*** Union Type ***/
|
|
|
|
export type ConfigAction =
|
|
|
|
| ChangeNodeAction
|
|
|
|
| ChangeLanguageAction
|
|
|
|
| ChangeGasPriceAction;
|