npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-tidy

v1.3.7

Published

A collection of atomic, independent, typed, tested and documented React custom hooks

Downloads

2,881

Readme

React Tidy

A collection of atomic, independent, typed, tested and documented React custom hooks.

Bundle size Tests Status Coverage Status Rank Version MIT

Contents

What is React Tidy?

React Tidy is a library of utility custom hooks. It's like lodash for React hooks. The goal is to provide a collection of tiny hooks that solve common problems or make writing React components easier.

Features

To keep the library tidy, all included hooks are:

  • Atomic: only does one thing and does it well.
  • Independent: does not depend on any external library/configuration/context to work. Just import and call it.
  • Typed: can infer the type of its arguments and give the correct type in return.
  • Tested: has meaningfull tests that cover all uses cases.
  • Documented: has it's own README describing the arguments, return and giving a usage example.

Installation

Install using npm

npm install react-tidy

Or using yarn

yarn add react-tidy

List of Custom Hooks

  • useIsMounted Avoid using/updating state of unmounted components.
  • useInstance Create an instance of any class and make your component react to its changes.
  • usePrevious Track previous values of a variable.
  • useRefresh Rerender your React component whenever you want.
  • useStorage read and write items on browser storages the React way.

Contributing

You can contribute to this library in many ways, including:

  • Reporting bugs: Simply open an issue and describe the bug. Please include a code snippet to reproduce the bug, it really helps to solve the problem quickly.

  • Suggesting new hooks: If you have a common use case that you think worth having its own hook, open an issue and we will discuss it. Do you already have an implementation for it? great, make a pull request and I will review it. Please make sure your code is consistent with the rest of the codebase and use Prettier and EditorConfig to format your files.

Those are just examples, any issue or pull request is welcome :)

Changelog

1.3.7 (April 17th 2023)

  • Update dev dependencies and Node version on Github actions.

1.3.6 (August 21th, 2022)

  • Update dev dependencies.

1.3.5 (April 2nd, 2022)

  • Update dev dependencies.

1.3.4 (March 3rd, 2022)

1.3.3 (February 27th, 2022)

  • Using parcel instead of tsdx and yarn instead of npm.

1.3.2 (November 13th, 2021)

  • Updating dev dependencies.

1.3.1 (May 27th, 2021)

  • Updating dev dependencies and improving docs.

1.3.0 (January 7th, 2021)

1.2.1 (January 2nd, 2021) Fix the bug of usePrevious not being exported.

1.2.0 (January 2nd, 2021) Add usePrevious hook.

1.1.1 (December 29, 2020) Upgrade dev dependencies.

1.1.0 (October 9, 2020) Make useStorage able to work on the server to enable SSR.

1.0.0 (September 23, 2020) The first official release containing 3 hooks useIsMounted, useRefresh and useStorage.