MyCrypto/common/actions/config.js
William O'Beirne 1aad9d1c21 Standardize Redux Actions / Reducers (#95)
* Convert Swap to consistent style

* Generate wallet reducer cleanup.

* Confirm empty action in swap reducer

* Union types. Fix gen wallet collision

* Fix not using all actions in reducer. Added reducer state for is fetching from bity. Added todo to make that a loader.

* Readme instructions.

* Remove common action constants.

* Bring all actions and reducers inline with readme instructions.

* Readme fixes

* address comments
2017-07-27 12:05:09 -05:00

48 lines
875 B
JavaScript

// @flow
/*** Change Language ***/
export type ChangeLanguageAction = {
type: 'CONFIG_LANGUAGE_CHANGE',
value: string
};
export function changeLanguage(sign: string): ChangeLanguageAction {
return {
type: 'CONFIG_LANGUAGE_CHANGE',
value: sign
};
}
/*** Change Node ***/
export type ChangeNodeAction = {
type: 'CONFIG_NODE_CHANGE',
// FIXME $keyof?
value: string
};
export function changeNode(value: string): ChangeNodeAction {
return {
type: 'CONFIG_NODE_CHANGE',
value
};
}
/*** 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;