0.1.3 • Published 6 years ago

grater-react v0.1.3

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

grater-react is a set of React components to interact with Grater.io.

Getting Started

yarn add grater-react

Demo

On the interweb

In the javascripts

Usage

It couldn't be easier to get up and running with your data from Grater.

In your React app:

import { DataFetcher } from 'grater-react'
 
 
const ExampleComponent = () => (
  <DataFetcher
    apiHost="<API_HOST>"
    canonicalName="<YOUR_ENDPOINT>"
    accessToken="<ACCESS_TOKEN_FOR_PRIVATE_ENDPOINTS>"
  >
    {({ data, error, loading }) => {
      if (loading) {
      
        // Fetching the data
        return <h1>Loading data...</h1>
        
      } else if (error) {
      
        // Error fetching data
        return <h1>There was an error...</h1>
        
      } else {
      
        // Successfully retrieved data
        return <h1>Do something with the data...</h1>
        
      }
    }}
  </DataFetcher>
)
 
  
export default ExampleComponent

~ your friends at Grater ~

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago