diff --git a/README.md b/README.md index 0884b4c..93f6509 100644 --- a/README.md +++ b/README.md @@ -116,14 +116,14 @@ const configuration: AxiosMorphismConfiguration = { #### Axios-Morphism Configuration -| Property | Type | Description | Example | -| -------------------------------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| url | ```string``` | Base URL to listen on | `https://swapi.co/api` | -| interceptors | ```{ responses: [], requests: []};``` | List of Responses and Requests Interceptors Configuration to register against Axios | -| interceptors.responses[].matcher | ```string | RegExp | Function``` | Matcher used to detect on which response to apply the transformer | - `'people/:id'`
- `/people$/i`
- `(response: AxiosResponse) => response.config.method === 'POST'` | -| interceptors.requests[].matcher | ```string | RegExp | Function``` | Matcher used to detect on which request to apply the transformer | - `'planets/:id'`
- `/planets$/i`
- `(request: AxiosRequestConfig) => request.url.includes('planets')` | -| interceptors.requests[].schema interceptors.responses[].schema | ```Schema | StrictSchema``` | A schema is an object-preserving map from one data structure to another. | [Morphism Schema Examples](https://github.com/nobrainr/morphism#schema-example) | -| interceptors.requests[].dataSelector interceptors.responses[].dataSelector | ```string``` | A selector to access the data in the Axios returned data | With this Axios Response: ```{ data: { results: [] }}```. Pick the data with ```{ dataSelector: 'results' }``` | +| Property | Type | Description | Example | +| -------------------------------------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| url | `string` | Base URL to listen on | `https://swapi.co/api` | +| interceptors | `{ responses: [], requests: []};` | List of Responses and Requests Interceptors Configuration to register against Axios | +| interceptors.responses[].matcher | `string | RegExp | Function` | Matcher used to detect on which response to apply the transformer | - `'people/:id'`
- `/people$/i`
- `(response: AxiosResponse) => response.config.method === 'POST'` | +| interceptors.requests[].matcher | `string | RegExp | Function` | Matcher used to detect on which request to apply the transformer | - `'planets/:id'`
- `/planets$/i`
- `(request: AxiosRequestConfig) => request.url.includes('planets')` | +| interceptors.requests[].schema interceptors.responses[].schema | `Schema | StrictSchema` | A schema is an object-preserving map from one data structure to another. | [Morphism Schema Examples](https://github.com/nobrainr/morphism#schema-example) | +| interceptors.requests[].dataSelector interceptors.responses[].dataSelector | `string` | A selector to access the data in the Axios returned data | With this Axios Response: `{ data: { results: [] }}`. Pick the data with `{ dataSelector: 'results' }` |