JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q32392F
  • License MIT

React Library for finnhub-ts

Package Exports

  • react-finnhub
  • react-finnhub/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-finnhub) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-finnhub

Docs and Source

building on finnhub-ts

Usage

Get your API-Key: https://finnhub.io/register

Provider

import { finnhubClient, FinnhubProvider } from 'react-finnhub'

const client = finnhubClient('YOUR-API-KEY')

<FinnhubProvider client={client}>
    <App />
</FinnhubProvider>

Hook

import React, { FunctionComponent, useState } from 'react'
import { BasicFinancials, useFinnhub } from 'react-finnhub'

type ITestProps = {}

export const App: FunctionComponent<ITestProps> = (props) => {
  const finnhub = useFinnhub()
  const [state, setState] = useState<BasicFinancials>()

  finnhub.companyBasicFinancials('AAPL', 'all').then((res) => setState(res.data))

  return <h1>{JSON.stringify(state)}</h1>
}