-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
executable file
·33 lines (28 loc) · 941 Bytes
/
index.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
32
33
/**
* @format
*/
// eslint-disable-next-line no-unused-vars
import React from 'react'
// eslint-disable-next-line no-unused-vars
import App from './src/components/App'
// eslint-disable-next-line no-unused-vars
import { Provider } from 'react-redux'
import {AppRegistry} from 'react-native'
import {name as appName} from './app.json'
import { createStore, applyMiddleware } from 'redux'
import rootReducer from '../DemoApp/src/redux/reducer/ReducerFactory'
import createSagaMiddleware from 'redux-saga'
import dataSaga from '../DemoApp/src/redux/saga/SagaFactory'
const sagaMiddleware = createSagaMiddleware()
function configureStore() {
const store = createStore(rootReducer, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(dataSaga)
return store
}
const store = configureStore()
const ReduxApp = () => (
<Provider store={store}>
<App />
</Provider>
)
AppRegistry.registerComponent(appName, () => ReduxApp)