reactotron-apisauce
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

reactotron-apisauce

Converts responses sent via apisauce into Reactotron.

Installing

npm i --save-dev reactotron-apisauce
# or
yarn add -D reactotron-apisauce

Configuring

In the file that you create your Redux store, add these two imports at the top:

// in your reactotron config (where you setup Reactotron) add this as a plugin.
import tronsauce from "reactotron-apisauce"

// then plug it in when you configure Reactotron.

Reactotron.configure()
  .use(tronsauce()) // <-- here we go!!!
  .connect()

// meanwhile, in a different file, when you get a response back
// from apisauce, pass it `Reactotron.apisauce(myAwesomeResponse)`
Reactotron.apisauce(theResponseWeJustTalkedAbout)

// Apisauce has a feature where you can attach a handler to watch
// all requests/response flowing through your api.  You can hook this up:
api.addMonitor(Reactotron.apisauce)

// or if you just wanted to track on 500's
api.addMonitor((response) => {
  if (response.problem === "SERVER_ERROR") Reactotron.apisauce(response)
})

// see https://github.com/infinitered/apisauce for more details.

/reactotron-apisauce/

    Package Sidebar

    Install

    npm i reactotron-apisauce

    Weekly Downloads

    2,972

    Version

    3.0.4

    License

    MIT

    Unpacked Size

    16.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • trevor-coleman
    • robin_heinze
    • joshuayoes
    • infinitered-owner
    • silasjmatson
    • kevinvangelder
    • kevinvangelder2
    • leonskim
    • jamonholmgren
    • derekgreenberg
    • ryanlntn
    • gantman
    • robinheinze
    • rmevans9
    • carlinisaacson
    • skellock