Skip to content

Commit

Permalink
Added mobx-rest-fetch-adapter in the description
Browse files Browse the repository at this point in the history
  • Loading branch information
masylum committed Mar 26, 2017
1 parent ff66634 commit a746a0f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ Exactly the same as the model one, but at the collection level.
### `apiClient`

This is the object that is going to make the `xhr` requests to interact with your API.
There is an example implementation for jQuery in the `mobx-rest-jquery-adapter` package.
There are two example implementations currently:

- One using `jQuery` in the `mobx-rest-jquery-adapter` package.
- One using `fetch` in the `mobx-rest-fetch-adapter` package.

## Simple Example

Expand All @@ -403,11 +406,11 @@ A collection looks like this:
```js
// TasksCollection.js
const apiPath = '/api'
import jqueryAdapter from 'mobx-rest-jquery-adapter'
import adapter from 'mobx-rest-fetch-adapter'
import { apiClient, Collection, Model } from 'mobx-rest'

// We will use the jQuery adapter to make the `xhr` calls
apiClient(jqueryAdapter, { apiPath })
// We will use the adapter to make the `xhr` calls
apiClient(adapter, { apiPath })

class Task extends Model { }
class Tasks extends Collection {
Expand Down

0 comments on commit a746a0f

Please sign in to comment.