tuitio-client-react/README.md

38 lines
1.4 KiB
Markdown

# Tuitio react client
## Introduction
Tuitio react client is an npm package written in typescript that facilitates the integration of a react application with [Tuitio](https://lab.code-rove.com/gitea/tudor.stanciu/tuitio).
This package uses [tuitio-client](https://lab.code-rove.com/gitea/bricks/tuitio-client#readme) internally and adds state management through react contexts and various react hooks through which the user has access to data and actions.
## Package installation
The package installation can be done in two ways:
- from the command line: `npm install @flare/tuitio-react-client@1.0.0`
- from the package.json file: `"@flare/tuitio-react-client": "1.0.0"`
## How to use the package
```javascript!
const { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken } = require("@flare/tuitio-react-client");
const TuitioProvider = require("@flare/tuitio-react-client");
```
```javascript!
import { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken } from "@flare/tuitio-react-client";
import TuitioProvider from "@flare/tuitio-react-client";
```
## Unit testing
Unit testing is done using [Jest](https://jestjs.io/). This is an awesome testing framework created by Facebook.
The files containing tests are identified by the extension `*.test.ts`.
All tests in the package can be executed by running: `npm test`.
## Changelog
1.0.0 - Package initialization