Skip to content

Commit

Permalink
Adds reactotron-apisauce documentation. (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
skellock committed Aug 23, 2016
1 parent c6ef607 commit c764b2c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
Binary file added docs/images/apisauce/apisauce.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions docs/plugin-apisauce.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# reactotron-apisauce

[Apisauce](http://github.com/skellock/apisauce) is a lightweight wrapper around the fantastic [Axios](https://github.com/mzabriskie/axios) networking library.

![API Response](./images/apisauce/apisauce.jpg)

# Installing

`npm i --save-dev reactotron-apisauce`


# Configuring

In the place where you setup your reactotron configuration, you import `reactotron-apisauce` plugin and throw it at Reactotron.

```js
import apisaucePlugin from 'reactotron-apisauce' // <--- import

// then plug it in when you configure Reactotron.

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

Next, wherever you create your api for you application, bring in Reactotron and attach the monitor to your apisauce instance.

```js
import Reactotron from 'reactotron-react-js'
// import Reactotron from 'reactotron-react-native' // or use this for mobile

// 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)
})
```
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ Welcome to flavour country.

* [Track Errors](docs/plugin-track-global-errors.md)
* Integrate with [Redux](docs/plugin-redux.md)
* Apisauce Plugin
* Creating Your Own Plugins
* Networking monitoring with [Apisauce](docs/plugin-apisauce.md)
* Start making fetch happen (plugin coming soon...)
* Creating Your Own Plugins (tutorial coming soon...)
* The JSON interface between client & server (coming soon...)


# Change Log
Expand Down

0 comments on commit c764b2c

Please sign in to comment.