Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

q2-tecton-hooks

nuevesolutions297Apache-2.00.0.5TypeScript support: included

react hooks for the q2 tecton sdk

q2-tecton-hooks, q2, tecton, react, hooks, bank, fi

readme

q2-tecton-hooks

GitHub stars

react hooks for the q2 tecton sdk

Please ★ this repo if you found it useful ★ ★ ★

Installation

npm install --save q2-tecton-sdk q2-tecton-hooks

Usage

index.tsx

import { render } from 'react-dom';
import { TectonProvider } from 'q2-tecton-hooks';
import App from './App';

render(
  <TectonProvider>
    <App />
  </TectonProvider>,
  document.getElementById('app')
);

App.tsx

import React, { FC } from 'react';
import { useTecton } from 'q2-tecton-hooks';

export interface AppProps {}

const App: FC<AppProps> = (props: AppProps) => {
  const tecton = useTecton();
  console.log(tecton);
  return <div>{tecton ? JSON.stringify(Object.keys(tecton)) : ''}</div>;
};

export default App;

Fetching Prop

Instead of using tecton?.actions?.setFetching(false), the fetching prop can be used to control fetching. If the fetching prop is not set, fetching will be set to false when tecton has loaded.

The following example will prevent fetching from automatically being set to false. Once the prop is set to false, fetching will be set to false.

index.tsx

import { render } from 'react-dom';
import { TectonProvider } from 'q2-tecton-hooks';
import App from './App';

render(
  <TectonProvider fetching>
    <App />
  </TectonProvider>,
  document.getElementById('app')
);

Hooks

Hook Description
useTecton core tecton api
useActions tecton actions
useSources tecton sources

Support

Submit an issue

Contributing

Review the guidelines for contributing

License

MIT License

Nueve Solutions LLC © 2020

Changelog

Review the changelog

Contributors

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[0.0.1] - 2020-10-14

Added

  • Initial release