forked from zzorba/ArkhamCards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
46 lines (36 loc) · 1.33 KB
/
index.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
42
43
44
45
import AsyncStorage from '@react-native-async-storage/async-storage';
import { persistCache } from 'apollo-cache-persist';
import { Navigation } from 'react-native-navigation';
import Crashes from 'appcenter-crashes';
import database from '@react-native-firebase/database';
import 'react-native-sqlite-storage';
import 'react-native-gesture-handler';
import 'react-native-console-time-polyfill';
import 'reflect-metadata';
import { registerScreens } from './src/app/screens';
import { store, persistor } from './src/app/store';
import App from './src/app/App';
import MyProvider from './src/app/MyProvider';
import { ENABLE_ARKHAM_CARDS_ACCOUNT } from './src/app_constants';
import createApolloClient from './src/data/apollo/createApolloClient';
if (ENABLE_ARKHAM_CARDS_ACCOUNT) {
database().setPersistenceEnabled(true);
}
const [apolloClient, anonClient] = createApolloClient(store);
persistCache({
cache: apolloClient.cache,
storage: AsyncStorage,
});
function shouldProcess() {
return !__DEV__;
}
Crashes.setListener({
shouldProcess,
});
/* eslint-disable @typescript-eslint/no-unused-vars */
let app = null;
Navigation.events().registerAppLaunchedListener(() => {
// SQLite.enablePromise(true);
registerScreens(MyProvider, { redux: store, persistor: persistor, apollo: apolloClient, anonApollo: anonClient });
app = new App(store);
});