-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.js
More file actions
31 lines (26 loc) · 721 Bytes
/
Copy pathApp.js
File metadata and controls
31 lines (26 loc) · 721 Bytes
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 {createStore, combineReducers, applyMiddleware} from 'redux';
import {Provider} from 'react-redux';
import ReduxThunk from 'redux-thunk';
import PlacesNavigator from './navigation/PlacesNavigator';
import placesReducer from './store/places-reducer';
import {init} from './helpers/db';
init()
.then(() => {
console.log('Initialized database!');
})
.catch(err => {
console.log('Initializing db failed!');
console.log(err);
});
const rootReducer = combineReducers({
places: placesReducer
});
const store = createStore(rootReducer, applyMiddleware(ReduxThunk));
export default function App() {
return (
<Provider store={store}>
<PlacesNavigator />
</Provider>
);
}