-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.ios.js
31 lines (25 loc) · 922 Bytes
/
index.ios.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
27
28
29
30
31
import React from 'react';
import { AppRegistry } from 'react-native';
import { Provider } from 'react-redux';
import { compose, createStore, combineReducers, applyMiddleware} from 'redux';
import { createLogger } from 'redux-logger';
import thunkMiddleware from 'redux-thunk';
import reducer from './src/reducers';
import AppContainer from './src/containers/AppContainer';
const loggerMiddleware = createLogger({ predicate: (getState, action) => __DEV__ });
function configureStore(initialState) {
const enhancer = compose(
applyMiddleware(
thunkMiddleware, // used to dispatch() functions
loggerMiddleware, // used for logging actions
),
);
return createStore(reducer, initialState, enhancer);
}
const store = configureStore({});
const App = () => (
<Provider store={store}>
<AppContainer />
</Provider>
)
AppRegistry.registerComponent('ReactNativeReduxBoilerplate', () => App);