Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pansyjs/react-hooks
react hooks
https://github.com/pansyjs/react-hooks
hooks mqtt react react-hooks typescript websocket
Last synced: about 1 month ago
JSON representation
react hooks
- Host: GitHub
- URL: https://github.com/pansyjs/react-hooks
- Owner: pansyjs
- License: mit
- Created: 2021-06-01T10:29:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T09:26:36.000Z (9 months ago)
- Last Synced: 2024-04-16T05:19:15.638Z (9 months ago)
- Topics: hooks, mqtt, react, react-hooks, typescript, websocket
- Language: TypeScript
- Homepage: https://hooks.xingkang.wang
- Size: 39.9 MB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
@pansy/react-hooks
[![NPM version][image-1]][npm-url]
[![NPM downloads][image-2]][npm-url]
[![codecov][codecov-1]][codecov-2]
[![license][license-1]][npm-url]
[![issues](https://img.shields.io/github/issues/pansyjs/react-hooks)](https://github.com/pansyjs/react-hooks/issues)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/pansyjs/react-hooks.svg)](http://isitmaintained.com/project/pansyjs/react-hooks 'Percentage of issues still open')
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/pansyjs/react-hooks.svg)](http://isitmaintained.com/project/pansyjs/react-hooks 'Average time to resolve an issue')## 📚 文档
[docs](https://react-hooks-chi.vercel.app/)
## ✨ 特性
- 📦 每个 Hook 单独发包,方便使用
- 🌵 包含丰富的基础 Hooks
- 💻 使用 TypeScript 编写,提供完善的类型定义## 🏗 安装
```
// npm
npm install @pansy/react-hooks --save// yarn
yarn add @pansy/react-hooks// pnpm
pnpm install @pansy/react-hooks
```**注意** 每个 Hook 单独发包,如只是用部分可单独安装对应的 Hook 包;
🔨 使用
```ts
import { useModal } from '@pansy/react-hooks';// or
import { useModal } from '@pansy/use-modal';
```## 🤝 参与共建
本仓库使用 [pnpm](https://pnpm.io/zh) 进行依赖管理,开发前请保证已安装
```sh
$ git clone [email protected]:pansyjs/react-hooks.git
$ cd react-hooks
$ pnpm install
$ pnpm start
```如何创建一个Hook, 执行以下命令,会帮你创建基本的文件
```sh
pnpm run hooks:create
```[image-1]: https://img.shields.io/npm/v/@pansy/react-hooks.svg?style=flat
[image-2]: https://img.shields.io/npm/dw/@pansy/react-hooks.svg?style=flat
[codecov-1]: https://codecov.io/github/pansyjs/react-hooks/branch/master/graph/badge.svg?token=EKYDUW28H0
[codecov-2]: https://codecov.io/github/pansyjs/react-hooks
[license-1]: https://badgen.net/npm/license/@pansy/react-hooks
[npm-url]: https://www.npmjs.com/package/@pansy/react-hooks
[issues-1]: https://www.npmjs.com/package/@pansy/react-hooks