on master help sign in
checkpoint: again
cec0b6dMatt Condon (shrugs)
src/bridge/Bridge.js+2−1
@@ -19,9 +19,9 @@ import {
19} from './lib/wallet';
19} from './lib/wallet';
20import { BRIDGE_ERROR } from './lib/error';
20import { BRIDGE_ERROR } from './lib/error';
21import { isDevelopment } from './lib/flags';
21import { isDevelopment } from './lib/flags';
22+import nest from './lib/nest';
22import { OnlineProvider } from './store/online';
23import { OnlineProvider } from './store/online';
23import { NetworkProvider } from './store/network';
24import { NetworkProvider } from './store/network';
24−import nest from './lib/nest';
25
25
26// NB(shrugs): toggle this variable to use the default local state.
26// NB(shrugs): toggle this variable to use the default local state.
27// don't commit changes to this line, but there shouldn't be a problem
27// don't commit changes to this line, but there shouldn't be a problem
@@ -64,6 +64,7 @@ const VariableWidthColumn = withHistory(({ history, children }) => (
64 </Col>
64 </Col>
65));
65));
66
66
67+// nest all of the providers within each other to avoid hella depth
67const AllProviders = nest([
68const AllProviders = nest([
68 HistoryProvider,
69 HistoryProvider,
69 TxnConfirmationsProvider,
70 TxnConfirmationsProvider,
src/bridge/lib/nest.js+1
@@ -1,5 +1,6 @@
1import { createFactory } from 'react';
1import { createFactory } from 'react';
2
2
3+// inspired by recompose/nest
3export default (components = []) => ({ children, ...props }) =>
4export default (components = []) => ({ children, ...props }) =>
4 components
5 components
5 .map(createFactory)
6 .map(createFactory)