-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
33 lines (29 loc) · 722 Bytes
/
App.js
File metadata and controls
33 lines (29 loc) · 722 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
32
33
import React from 'react';
import PhoneBookNavigation from './navigation/PhoneBookNavigation';
import {
createStore,
combineReducers,
applyMiddleware
} from 'redux';
import { Provider } from 'react-redux';
import reduxThunk from 'redux-thunk';
import contactReducer from './store/contact-reducers';
import { init } from './helpers/db';
init()
.then(() => {
console.log('Connection database ok!');
}).catch((err) => {
console.log(`Erro: ${err}`);
throw err;
})
const rootReducer = combineReducers({
contacts: contactReducer
})
const store = createStore(rootReducer, applyMiddleware(reduxThunk));
export default function App() {
return (
<Provider store={store}>
<PhoneBookNavigation/>
</Provider>
);
}