reactotron-apisauce

3.0.0 • Public • Published

reactotron-apisauce

Converts responses sent via apisauce into Reactotron.

Installing

npm i --save-dev 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/skellock/apisauce for more details.

Keywords

none

Install

npm i reactotron-apisauce

DownloadsWeekly Downloads

2,233

Version

3.0.0

License

MIT

Unpacked Size

7.53 kB

Total Files

5

Last publish

Collaborators

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