-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
40 lines (31 loc) · 1.06 KB
/
App.js
File metadata and controls
40 lines (31 loc) · 1.06 KB
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
import { Navigation } from 'react-native-navigation';
import { createStore, applyMiddleware } from 'redux';
import axios from 'axios';
import axiosMiddleWare from 'redux-axios-middleware';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import reducer from './src/reducers/reducer';
import { registerScreens } from './src/screens';
const client = axios.create({
baseURL: 'https://sample-videos.com',
});
const persistConfig = {
key: 'root',
storage: storage,
stateReconciler: autoMergeLevel2 // see "Merge Process" section for details.
};
const pReducer = persistReducer(persistConfig, reducer);
const store = createStore(pReducer, applyMiddleware(axiosMiddleWare(client)));
Navigation.events().registerAppLaunchedListener(() => {
persistStore(store, null, () => {
registerScreens(store);
Navigation.setRoot({
root: {
component: {
name: 'example.VideoFeed'
}
}
});
});
});