0.2.3 • Published 3 years ago

@mosesthesweed/react-dero-api v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React Dero Api

UNDER DEVELOPMENT -- DO NOT USE

Description:

This is an npm package consisting of a functional component hook for each Dero API call available in the dependency package 'dero-rpc-bridge-api', which is a dependency of this package

Usage

The response object is generalized for every hook and managed by a React Context. There is a React Context for the bridge as well -- Both need to be wrapped around a component where it makes sense, perhaps like this if it were in main.js:

export const Providers = ({children}) => {
  return (
    <BridgeProvider>
      <ApiResponseProvider>
        {children}
      </ApiResponseProvider>
    </BridgeProvider>
  )
}

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <Providers>
      <App />
    </Providers>
  </React.StrictMode>
)

Then, within a component where you want to make a Dero API call, for example getTxPool, you would use the hook like this:

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago