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

anzol

v4.1.0

Published

A react hooks library.

Downloads

24

Readme

NPM Package MIT License Type Definitions Code Coverage NPM Downloads

Anzol provides very useful client-side React hooks for very common tasks such as data fetching or deferring the updating of values with a custom timeout. It supports both SSG and SSR. You can find working examples in the documentation or, if you just want the code, in the examples/components directory.

Features:

  • ✅ Fully Tested
  • ✅ SSR and SSG compatible
  • ✅ Detailed documentation

Installation

Anzol is available on the NPM registry. To install it, just run:

npm install anzol

Currently Available Hooks

  • useFetch: Fetches the provided URL and optionally parses the response. Aborts requests when a new request is started before the previous has finished to prevent flickering of stale responses by default.
  • useDefer: Delays the update of a value until the input has stopped changing for a certain time. This is different from React's built-in useDeferredValue because you can set the delay yourself.
  • useFirstRender: Returns true on first render; false otherwise.
  • useToggle: Provides a boolean toggle that does not persist between page reloads.
  • useIntersectionObserver: Provides a hook API that wraps the IntersectionObserver API. This hook is for use with a single element only. For simplicity this is the recommended approach. If you have an extremely large number of objects to observe and want to avoid creating an IntersectionObserver for each, refer to useIntersectionObserverArray to use a single observer for multiple elements with a common root.
  • useIntersectionObserverArray: Like useIntersectionObserver but for multiple elements.
  • useEvent: Provides a wrapper around the EventListener API. Use the return value to define the event target.
  • useLazyLoad: Provides a simple API for fetching data from a resource in batches.
  • useLocalStorage: Provides access to local storage, with the additional option to update all usages of this hook when local storage changes.
  • useClickOutside: Provides a ref to attach to an HTML element and takes a callback function, and calls that function when the user clicks anywhere outside the given element.
  • usePreferredScheme: Listens for changes in the user's preferred scheme and returns it.