Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// configure reactotron
Tron.configure({
name: this.config.name || require("../../../package.json").name,
host: this.config.host,
})
// hookup middleware
Tron.useReactNative({
asyncStorage: this.config.useAsyncStorage ? undefined : false,
})
// ignore some chatty `mobx-state-tree` actions
const RX = /postProcessSnapshot|@APPLY_SNAPSHOT/
// hookup mobx-state-tree middleware
Tron.use(
mst({
filter: event => RX.test(event.name) === false,
}),
)
// connect to the app
Tron.connect()
// Register Custom Commands
Tron.onCustomCommand({
title: "Reset Root Store",
description: "Resets the MST store",
command: "resetStore",
handler: () => {
console.tron.log("resetting store")
clear()
Reactotron.configure({
name: 'Demo App'
// host: '10.0.1.1',
// port: 9091
})
// add every built-in react native feature. you also have the ability to pass
// an object as a parameter to configure each individual react-native plugin
// if you'd like.
Reactotron.useReactNative({
asyncStorage: { ignore: ['secret'] }
})
// add some more plugins for redux & redux-saga
Reactotron.use(reduxPlugin())
Reactotron.use(sagaPlugin())
// if we're running in DEV mode, then let's connect!
if (__DEV__) {
Reactotron.connect()
Reactotron.clear()
}
Reactotron.onCustomCommand('test', () => console.tron.log('This is an example'))
console.tron = Reactotron
Reactotron.setAsyncStorageHandler(AsyncStorage)
Reactotron.configure({
name: 'Demo App'
// host: '10.0.1.1',
// port: 9091
})
// add every built-in react native feature. you also have the ability to pass
// an object as a parameter to configure each individual react-native plugin
// if you'd like.
Reactotron.useReactNative({
asyncStorage: { ignore: ['secret'] }
})
// add some more plugins for redux & redux-saga
Reactotron.use(reduxPlugin())
Reactotron.use(sagaPlugin())
// if we're running in DEV mode, then let's connect!
if (__DEV__) {
Reactotron.connect()
Reactotron.clear()
}
Reactotron.onCustomCommand('test', () => console.tron.log('This is an example'))
console.tron = Reactotron
import { mst } from "reactotron-mst"
import { ArgType } from "reactotron-core-client"
Reactotron.configure({
name: "Demo App",
})
Reactotron.setAsyncStorageHandler(AsyncStorage)
Reactotron.useReactNative({
asyncStorage: {
ignore: ["ignore-me"],
},
})
Reactotron.use(reduxPlugin())
Reactotron.use(sagaPlugin({}))
Reactotron.use(mst())
Reactotron.onCustomCommand("test", () => console.log("This is an example"))
Reactotron.onCustomCommand({
command: "test2",
handler: params => {
Alert.alert("A message from Reactotron", params.message)
},
// Optional settings
title: "Show a message",
description: "Alert in the app for absolutely no reason at all.",
args: [
{
Reactotron.configure({
name: "Demo App",
})
Reactotron.setAsyncStorageHandler(AsyncStorage)
Reactotron.useReactNative({
asyncStorage: {
ignore: ["ignore-me"],
},
})
Reactotron.use(reduxPlugin())
Reactotron.use(sagaPlugin({}))
Reactotron.use(mst())
Reactotron.onCustomCommand("test", () => console.log("This is an example"))
Reactotron.onCustomCommand({
command: "test2",
handler: params => {
Alert.alert("A message from Reactotron", params.message)
},
// Optional settings
title: "Show a message",
description: "Alert in the app for absolutely no reason at all.",
args: [
{
name: "message",
type: ArgType.String,
import { ArgType } from "reactotron-core-client"
Reactotron.configure({
name: "Demo App",
})
Reactotron.setAsyncStorageHandler(AsyncStorage)
Reactotron.useReactNative({
asyncStorage: {
ignore: ["ignore-me"],
},
})
Reactotron.use(reduxPlugin())
Reactotron.use(sagaPlugin({}))
Reactotron.use(mst())
Reactotron.onCustomCommand("test", () => console.log("This is an example"))
Reactotron.onCustomCommand({
command: "test2",
handler: params => {
Alert.alert("A message from Reactotron", params.message)
},
// Optional settings
title: "Show a message",
description: "Alert in the app for absolutely no reason at all.",
args: [
{
name: "message",
async setup() {
// only run this in dev... metro bundler will ignore this block: 🎉
if (__DEV__) {
// configure reactotron
Tron.configure({
name: this.config.name || require("../../../package.json").name,
host: this.config.host,
})
// hookup middleware
Tron.useReactNative({
asyncStorage: this.config.useAsyncStorage ? undefined : false,
})
Tron.use(
mst({
filter: event => {
return !event.name.endsWith("@APPLY_SNAPSHOT")
},
}),
)
Tron.use(withCustomActions(() => this.rootStore))
// connect to the app
Tron.connect()
// clear if we should
if (this.config.clearOnLoad) {
Tron.clear()
}
})
// hookup middleware
Tron.useReactNative({
asyncStorage: this.config.useAsyncStorage ? undefined : false,
})
Tron.use(
mst({
filter: event => {
return !event.name.endsWith("@APPLY_SNAPSHOT")
},
}),
)
Tron.use(withCustomActions(() => this.rootStore))
// connect to the app
Tron.connect()
// clear if we should
if (this.config.clearOnLoad) {
Tron.clear()
}
}
}
}