-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
37 lines (33 loc) · 888 Bytes
/
App.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
34
35
36
37
import React from "react";
import { createStore, applyMiddleware } from "redux";
import { Provider, connect } from "react-redux";
import AppWithNavigationState, { middleware } from "./containers/AppNavigator";
import rootReducer from "./reducers";
import createSagaMiddleware from "redux-saga";
import {productWatchers} from "./sagas/product";
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
rootReducer,
{
productState: {
products: [],
product: {},
isLoading: false,
isRefreshing: false,
page: 1,
limit:8
},
storeState: { stores: [], isLoading: false }
},
applyMiddleware(middleware, sagaMiddleware)
);
sagaMiddleware.run(productWatchers);
export default class Root extends React.Component {
render() {
return (
<Provider store={store}>
<AppWithNavigationState />
</Provider>
);
}
}