react-ajax-client
Consume rest endpoints using react components. Inspired by ApolloClient
Install
npm install --save react-ajax-client
yarn add react-ajax-client
Usage
; ; ; ; ; ;
Components
Client
Instantiation
;
yarn add react-ajax-client
Usage
;; ; ; ;
Components
Client
Option | Type | Default | Description |
---|---|---|---|
baseURL | string | "" | The api endpoint of the backend |
headers | object | {} | A key value pair of http headers |
onRequest | function | a middleware function called before each request passed the request instance | |
onResponse | function | a afterware function called after each request passed the response instance |
Provider
Wrap your root component with this Provider
Param | Type | Description |
---|---|---|
client | Client | An instance of the Client Class |
Fetch
Send
Provider
Fetch
Send
License
MIT © aiosifelis