MyCrypto/common/reducers/wallet.js

21 lines
526 B
JavaScript
Raw Normal View History

2017-06-29 16:03:11 -07:00
// @flow
import type { WalletAction, SaveWalletAction } from 'actions/wallet';
import BaseWallet from 'libs/wallet/base';
export type State = ?BaseWallet;
const initialState: State = null;
function saveWallet(state: State, action: SaveWalletAction): State {
return action.payload;
}
export function wallet(state: State = initialState, action: WalletAction): State {
switch (action.type) {
case 'WALLET_SAVE':
return saveWallet(state, action);
default:
return state;
}
}