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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cheems_react_hooks

v2.0.0

Published

一个方便前端开发的react包

Downloads

14

Readme

安装

npm install cheems_react_hooks

使用

useLatest: 永远返回最新值,避免闭包问题
useMount: 生命周期hook,只在初始化的时候执行
useUnmount: 生命周期hook,在卸载的时候执行
useUnmountedRef: 判断当前组件是否卸载
useSafeState: 卸载后,异步回调内的setState不再执行,可以避免组件卸载后更新状态导致的内存泄漏
useUpdate: 强制组件重新渲染
useCreation: 强化useMemo,多进行一层手动依赖对比
useReactive: 具备响应式更新的setState
useDebounceFn: 防抖hooks,防抖方法
useDebounce: 防抖hooks,防抖值
useThrottleFn: 节流hooks,节流方法
useThrottle: 节流hooks,节流值
useLockFn: 竞态锁hooks,方法
useFullscreen: 全屏hooks
useCopy: 复制hooks
useTextSelection: 选中文本hooks
useResponsive: 浏览器响应式hooks,监听屏幕变化
configResponsive: 浏览器响应式hooksConfig,设置监听值
useTrackedEffect: 监听依赖变化hooks
useEventListener: 监听事件hooks
useHover: 监听鼠标hover状态hooks
useDocumentVisibility: 监听是否处于屏幕可见状态
useNetwork: 监听网络状态hooks
useInViewport: 监听可视区域hooks
useCss: 样式hooks,动态修改css(CSS-IN-JS)
useSelections: 管理Selection选中状态的hooks
useCountDown: 管理倒计时hook