1.1.7 • Published 4 years ago

react-sports-hooks v1.1.7

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

React Sports Hooks

Get live sports scores in your React app for the MLB, NBA, and the NFL.

NPM JavaScript Style Guide

Install

npm install --save react-sports-hooks

Usage

import React from 'react'

import { useScores } from 'react-sports-hooks'

const MyComponent = () => {
  const { scores } = useScores("mlb")

    return (
      ...
    )
}

Options

You can pass in an options object as the second arg when you instantiate useScores that can take the following options:

  • updateIntervalSeconds (number): How often the data is refreshed, default is 30 seconds.

Example with Options

import React from 'react'

import { useScores } from 'react-sports-hooks'

const MyComponent = () => {
  const { scores } = useScores("mlb", { updateIntervalSeconds: 3 })

    return (
      ...
    )
}

License

MIT © andrewrjohn

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago