Skip to content

A JSON Rpc client for React that uses promises to call to JSON Rpc APIs.

Notifications You must be signed in to change notification settings

evanlihou/react-jsonrpc-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

react-jsonrpc-client

A JSON Rpc client for React that uses promises to call to JSON Rpc APIs.

Usage Example

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

About

A JSON Rpc client for React that uses promises to call to JSON Rpc APIs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published