Giter VIP home page Giter VIP logo

useful's Introduction

Useful: a React Hooks Library

Welcome to Useful! This library provides a collection of efficient and modern React hooks to enhance your application development experience. These hooks are designed to simplify common tasks, improve code reusability, and promote best practices in your React projects. Useful is written in TypeScript, uses Vite for its development environment, and Vitest for unit testing.

Useful officially supports React v18.0 and newer.

Documentation

Read the full documentation at https://docs.usefulhooks.com.

Installation

npm install @ridgehkr/useful

Or, with Yarn:

yarn add @ridgehkr/useful

Development

This project uses Yarn as its package manager. To get started, first install all project dependencies:

yarn

Spin up the development server:

npm run dev

Or, with Yarn:

yarn dev

All hooks live in /src/hooks/, and their associated unit tests are in /src/tests/. Every hook follows the standard hook naming convention of "use[hook capability]", e.g. useFetch or useLocalStorage.

Unit test files use the name format of [hook name].test.tsx, e.g. useFetch.test.tsx or useLocalStorage.test.tsx. All unit tests for a hook should exist in their associated test file and nowhere else.

Unit tests

Useful relies on Vitest for its unit testing framework. The test results can be seen either in the console (test task) or in a browser (test:ui). The scripts, when running, will watch your test files and automatically run again when any changes are made.

Note that most hooks don't have unit tests yet. If you'd like to contribute to this effort, please submit a pull request!

Test Scripts

Run all tests in the console:

npm run test

Or, with Yarn:

yarn test

Run all unit tests as well as Vitest's live test status UI:

npm run test:ui

Or, with Yarn:

yarn test:ui

Contributing

Useful thrives on contributions from developers like you! If you encounter issues or have any suggestions for improvements, please feel free to contribute by opening an issue or submitting a pull request in the GitHub repository.

License

This project is licensed under the MIT License.

Written by Caleb Pierce.

useful's People

Contributors

ridgehkr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.