-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
41 lines (35 loc) · 978 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
38
39
40
41
import * as React from 'react';
import { StyleSheet, LogBox } from 'react-native';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import ReduxThunk from 'redux-thunk';
import comicsReducer from './store/comics-reducer';
import Database from './Database';
import Main from './components/Main';
const db = new Database();
LogBox.ignoreAllLogs();
db.initDB().then(() => {
console.log('Initialized database...');
}).catch(err => {
console.log('Intializing database failed.');
console.log(err);
});
const rootReducer = combineReducers({
comics: comicsReducer
});
const store = createStore(rootReducer, applyMiddleware(ReduxThunk));
export default function App() {
return (
<Provider store={store}>
<Main />
</Provider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});