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

diy-hooks

v1.0.13

Published

一个自定义 React Hooks 库。

Downloads

56

Readme

介绍

diy-hooks 库主要收录了平时业务开发中常用的自定义 React Hooks, 并且还包含 Hzero、C7N UI 项目使用的 hooks。

安装依赖

$ yarn add diy-hooks
# or
$ npm install diy-hooks

简单使用

import React from 'react';
import { useMount } from 'diy-hooks';

export default () => {
  useMount(() => {
    console.log('挂载了');
  });

  return <div>挂载</div>;
};

支持 TypeScript

diy-hooks库导出了类型声明文件,可在 TS 项目中直接使用。

按需加载

diy-hooks 默认支持基于 ES module 的 tree shaking。
直接写成 import { useMount } from 'diy-hooks' 就有按需加载效果。

文档阅读说明

项目的文档库基于 dumi 搭建,并通过 Github Pages 部署在 https://hzm0321.github.io/diy-hooks/
可根据 hooks 类型分组,阅读此文档。每个分组都有一篇简介说明该分组下说包含的 hooks 概要,可据此查找对应 hook。 如有疑问,请联系作者。
QQ:934585316
微信:hzm0321hzm

国内镜像

如果文档页面访问过慢,可以访问国内镜像站点http://hzm0321.gitee.io/diy-hooks/

学习

如果你也想从零开始构建一个像 diy-hooks 这样的 React Hooks 库,可以参考我的系列文章: