Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
},
})
Tron.onCustomCommand({
title: "Reset Navigation Store",
description: "Resets the navigation store",
command: "resetNavigation",
import Immutable from 'seamless-immutable'
import Reactotron from 'reactotron-react-native'
import { reactotronRedux as reduxPlugin } from 'reactotron-redux'
import sagaPlugin from 'reactotron-redux-saga'
// https://github.com/infinitered/reactotron for more options!
Reactotron
.configure({ name: 'Chain React App' })
.useReactNative()
.use(reduxPlugin({ onRestore: Immutable }))
// register the redux-saga plugin so we can use the monitor in CreateStore.js
.use(sagaPlugin())
if (Config.useReactotron) {
// let's connect!
Reactotron.connect()
// Let's clear Reactotron on every time we load the app
Reactotron.clear()
// Totally hacky, but this allows you to not both importing reactotron-react-native
// on every file. This is just DEV mode, so no big deal.
}
console.tron = Reactotron
import sagaPlugin from 'reactotron-redux-saga';
import Config from '.';
Reactotron.configure({
name: 'Thinger.io',
// host: '192.168.31.161',
})
.useReactNative()
.use(asyncStorage())
.use(apisaucePlugin())
.use(reactotronRedux())
.use(sagaPlugin());
if (Config.useReactotron) {
Reactotron.connect().clear();
console.tron = Reactotron;
} else {
console.tron = console.log;
}
})
// 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
public async setup() {
if (__DEV__) {
Tron.configure({
name: require('../../../package.json').name,
host: 'localhost',
});
// hookup middleware
Tron.useReactNative({
storybook: true
});
Tron.connect();
Tron.clear();
}
}
}
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()
}
}
}
}
args: [
{
name: "message",
type: ArgType.String,
},
],
})
const selfRemoving = Reactotron.onCustomCommand({
command: "remove",
handler: () => {
selfRemoving()
},
})
Reactotron.connect()
Reactotron.clear()
const aThing = {
aFunc: () => {
return 10
},
aVal: "Test",
aObj: {
nested: true,
num: 12312314,
},
aArr: [1, "two", { three: true }],
}
Reactotron.repl("thing", aThing)