-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwrapper.js
26 lines (23 loc) · 923 Bytes
/
wrapper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import React from 'react';
import {applyMiddleware, combineReducers, createStore} from 'redux';
import {Provider} from 'react-redux';
import createLogger from 'redux-logger';
import App from './app/app';
import * as reducers from './app/reducers';
import promiseMiddleware from './app/lib/promiseMiddleware';
import inAppNotificationMiddleware from './app/lib/inAppNotificationMiddleware';
// import Icon from 'react-native-vector-icons/FontAwesome';
const middlewares = [promiseMiddleware, inAppNotificationMiddleware];
if (process.env.NODE_ENV === 'development') {
const logger = createLogger();
middlewares.push(logger);
}
const createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore);
const rootReducer = combineReducers({...reducers});
const store = createStoreWithMiddleware(rootReducer);
const wrapper = () => (
<Provider store={store}>
<App />
</Provider>
);
export default wrapper;