forked from osamaqarem/spotify-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reactotron.ts
30 lines (24 loc) · 953 Bytes
/
reactotron.ts
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
import Reactotron from "reactotron-react-native"
import AsyncStorage from "@react-native-community/async-storage"
import { reactotronRedux } from "reactotron-redux"
declare global {
interface Console {
tron: typeof console.log
rtron: Required<typeof Reactotron>
}
}
let reactotron
if (__DEV__) {
reactotron = Reactotron.setAsyncStorageHandler!(AsyncStorage) // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from
.configure() // controls connection & communication settings
.use(reactotronRedux())
.useReactNative({
networking: {
ignoreUrls: /https:\/\/clients3.google.com\/generate_204/,
},
}) // add all built-in react native plugins
reactotron.connect()
console.rtron = reactotron as Required<typeof Reactotron>
console.tron = reactotron.logImportant!
}
export default reactotron as Required<typeof Reactotron>