mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-12 03:54:13 +00:00
1aad9d1c21
* 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
26 lines
504 B
JavaScript
26 lines
504 B
JavaScript
// @flow
|
|
import type { SetRatesAction, RatesAction } from 'actions/rates';
|
|
|
|
// SYMBOL -> PRICE TO BUY 1 ETH
|
|
export type State = {
|
|
[key: string]: number
|
|
};
|
|
|
|
export const INITIAL_STATE: State = {};
|
|
|
|
function setRates(state: State, action: SetRatesAction): State {
|
|
return action.payload;
|
|
}
|
|
|
|
export function rates(
|
|
state: State = INITIAL_STATE,
|
|
action: RatesAction
|
|
): State {
|
|
switch (action.type) {
|
|
case 'RATES_SET':
|
|
return setRates(state, action);
|
|
default:
|
|
return state;
|
|
}
|
|
}
|