1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-12 11:28:56 +00:00
trezor-wallet/src/reducers/index.js

71 lines
2.1 KiB
JavaScript
Raw Normal View History

2017-12-13 11:01:37 +00:00
/* @flow */
import { combineReducers } from 'redux';
import { connectRouter } from 'connected-react-router';
2019-01-02 15:42:07 +00:00
import type { State } from 'connected-react-router';
2019-04-10 15:50:07 +00:00
import type { Action } from 'flowtype';
2017-12-13 11:01:37 +00:00
2018-08-14 14:06:34 +00:00
import log from 'reducers/LogReducer';
import localStorage from 'reducers/LocalStorageReducer';
import connect from 'reducers/TrezorConnectReducer';
import notifications from 'reducers/NotificationReducer';
import modal from 'reducers/ModalReducer';
import web3 from 'reducers/Web3Reducer';
import accounts from 'reducers/AccountsReducer';
2019-04-10 17:54:07 +00:00
import importAccount from 'reducers/ImportAccountReducer';
2018-08-14 14:06:34 +00:00
import selectedAccount from 'reducers/SelectedAccountReducer';
import sendFormEthereum from 'reducers/SendFormEthereumReducer';
import sendFormRipple from 'reducers/SendFormRippleReducer';
2018-08-14 14:06:34 +00:00
import receive from 'reducers/ReceiveReducer';
import summary from 'reducers/SummaryReducer';
import tokens from 'reducers/TokensReducer';
import discovery from 'reducers/DiscoveryReducer';
import pending from 'reducers/PendingTxReducer';
import fiat from 'reducers/FiatRateReducer';
import wallet from 'reducers/WalletReducer';
import devices from 'reducers/DevicesReducer';
2018-09-12 09:49:49 +00:00
import blockchain from 'reducers/BlockchainReducer';
import signVerify from 'reducers/SignVerifyReducer';
2017-12-13 11:01:37 +00:00
2019-01-02 15:42:07 +00:00
const reducers = {
2018-03-08 16:10:53 +00:00
log,
2018-02-20 09:30:36 +00:00
localStorage,
2017-12-13 11:01:37 +00:00
connect,
2018-02-20 09:30:36 +00:00
notifications,
2017-12-13 11:01:37 +00:00
modal,
web3,
2019-04-10 17:54:07 +00:00
importAccount,
2018-02-20 09:30:36 +00:00
accounts,
2018-05-18 17:26:46 +00:00
selectedAccount,
sendFormEthereum,
sendFormRipple,
2018-02-20 09:30:36 +00:00
receive,
summary,
tokens,
2018-03-08 16:10:53 +00:00
discovery,
pending,
fiat,
wallet,
2018-07-30 10:52:13 +00:00
devices,
2018-09-23 06:36:01 +00:00
blockchain,
signVerify,
2019-03-04 12:33:02 +00:00
router: () =>
({
location: {
pathname: '',
hash: '',
search: '',
state: {},
},
}: State),
2019-01-02 15:42:07 +00:00
};
2018-04-16 21:19:50 +00:00
export type Reducers = typeof reducers;
type $ExtractFunctionReturn = <V>(v: (...args: any) => V) => V;
export type ReducersState = $ObjMap<Reducers, $ExtractFunctionReturn>;
2019-01-02 15:42:07 +00:00
2019-04-10 15:50:07 +00:00
export default (history: Object) =>
combineReducers<Reducers, Action>({
2019-03-04 12:33:02 +00:00
...reducers,
router: connectRouter(history),
});