Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evanlihou/react-jsonrpc-client
A JSON Rpc client for React that uses promises to call to JSON Rpc APIs.
https://github.com/evanlihou/react-jsonrpc-client
javascript json-rpc-client promise react
Last synced: 3 months ago
JSON representation
A JSON Rpc client for React that uses promises to call to JSON Rpc APIs.
- Host: GitHub
- URL: https://github.com/evanlihou/react-jsonrpc-client
- Owner: evanlihou
- Created: 2018-03-01T20:56:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-19T17:52:24.000Z (over 5 years ago)
- Last Synced: 2024-10-11T03:17:12.887Z (3 months ago)
- Topics: javascript, json-rpc-client, promise, react
- Language: JavaScript
- Size: 2.93 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-jsonrpc-client
A JSON Rpc client for React that uses promises to call to JSON Rpc APIs.## Usage Example
```javascript
import JsonRpcClient from '/path/to/jsonrpcclient'
class TutoringCalendar extends Component {
componentDidMount() {
var api = new JsonRpcClient({
endpoint: 'https://url.to/api',
headers: {
'X-Token': this.state.token
}
})
api.request(
METHOD_NAME,
PARAM_1,
PARAM_2,
PARAM_3
).then(function(response) {
this.setState({apiResponse: response})
}.bind(this)) // End .then()
} // End componentDidMount
} // End class