How to use the reactotron-react-native.onCustomCommand function in reactotron-react-native

To help you get started, we’ve selected a few reactotron-react-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github infinitered / ignite-bowser / boilerplate / app / services / reactotron / reactotron.ts View on Github external
// 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",
        handler: () => {
          console.tron.log("resetting navigation store")
          this.rootStore.navigationStore.reset()
        },
      })

      // clear if we should
      if (this.config.clearOnLoad) {
        Tron.clear()
      }
    }
  }
}
github infinitered / reactotron / examples / ReactotronTester / app / config / ReactotronConfig.ts View on Github external
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,
    },
  ],
})
github infinitered / reactotron / examples / ReactotronTester / app / config / ReactotronConfig.ts View on Github external
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,
    },
  ],
github infinitered / reactotron / examples / demo-react-native / App / Config / ReactotronConfig.js View on Github external
// 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
github infinitered / reactotron / examples / ReactotronTester / app / config / ReactotronConfig.ts View on Github external
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,
    },
  ],
})

const selfRemoving = Reactotron.onCustomCommand({
  command: "remove",
  handler: () => {
    selfRemoving()
  },
})

Reactotron.connect()
Reactotron.clear()

const aThing = {
  aFunc: () => {
    return 10
  },
  aVal: "Test",
  aObj: {
    nested: true,