39 lines
1.4 KiB
Markdown
39 lines
1.4 KiB
Markdown
# Tuitio client react
|
|
|
|
## Introduction
|
|
|
|
Tuitio client react 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-client-react@1.0.0`
|
|
- from the package.json file: `"@flare/tuitio-client-react": "1.0.0"`
|
|
|
|
## How to use the package
|
|
|
|
```javascript!
|
|
const { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken } = require("@flare/tuitio-client-react");
|
|
const TuitioProvider = require("@flare/tuitio-client-react");
|
|
|
|
```
|
|
|
|
```javascript!
|
|
import { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken } from "@flare/tuitio-client-react";
|
|
import TuitioProvider from "@flare/tuitio-client-react";
|
|
```
|
|
|
|
## 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
|
|
1.0.1 - Added useTuitioClient default options
|