aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-14 06:28:44 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-14 06:28:44 +0800
commitd814a45dffa6a872f6e336cad33ca41ffb102887 (patch)
treed8cdd0c4b8c6559efaf6846b24f0d6440f3c94f5 /ui/app/reducers.js
parent9f1438b85b3dac8f1dd98f7bd6e101035cfce0a5 (diff)
downloadtangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.gz
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.bz2
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.lz
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.xz
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.tar.zst
tangerine-wallet-browser-d814a45dffa6a872f6e336cad33ca41ffb102887.zip
Moved UI into repo with its own dependency stack
Diffstat (limited to 'ui/app/reducers.js')
-rw-r--r--ui/app/reducers.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/ui/app/reducers.js b/ui/app/reducers.js
new file mode 100644
index 000000000..0f2ad4c21
--- /dev/null
+++ b/ui/app/reducers.js
@@ -0,0 +1,41 @@
+const combineReducers = require('redux').combineReducers
+const actions = require('./actions')
+const extend = require('xtend')
+
+//
+// Sub-Reducers take in the complete state and return their sub-state
+//
+const reduceIdentities = require('./reducers/identities')
+const reduceMetamask = require('./reducers/metamask')
+const reduceApp = require('./reducers/app')
+
+module.exports = rootReducer
+
+function rootReducer(state, action) {
+
+ // clone
+ state = extend(state)
+
+ //
+ // Identities
+ //
+
+ state.identities = reduceIdentities(state, action)
+
+ //
+ // MetaMask
+ //
+
+ state.metamask = reduceMetamask(state, action)
+
+ //
+ // AppState
+ //
+
+ state.appState = reduceApp(state, action)
+
+
+ return state
+
+}
+