Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@newstudios/hook

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@newstudios/hook

common hooks for react

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@newstudios/hook

NPM Version

Installation

npm install @newstudios/hook

or

yarn add @newstudios/hook

Starter

hooks

  • useArrowKey listen to arrow key state change and get the latest state
  • useInvalidator use invalidator to invalidate the target at the next animation frame
  • useCanvasInvalidator a special invalidator to draw canvas at the next aniation frame
  • useClickAway listen click event outside the target
  • useDevicePixelRatio listen to the device pixel ratio change and get the latest devicePixelRatio
  • useDrag a simple hook to process the dragging state and callback
  • useEvent a hook to bind listener(s) to event target
  • useHover a hook to get the mouse hover state of the target
  • useList a hook to manage collections
  • useUpdate get a static callback to force update the component
  • useNextUpdate get a static callback to update the componenent next event loop
  • useRaf a hook to call requestAnimationFrame whose lifecycle is self managed
  • useRefObject a hook to reference any object from the argument
  • useResize a hook to listen to the resize event of the target
  • useResizeObserver a hook to get the default or customed provided ResizeObserver instance
  • useSafeClick manage the click event from the target and assure the gesture not to be dragging
  • useSetupCanvas a hook for setup the canvas and set the canvas width and height automatically
  • useShortcutKey listen to the shortcut key
  • useShortcutKeys listen to the multiple shortcut keys
  • useThrottle invoke a callback with throttle
  • useThrottleCallback get a callback which will be invoked with throttle

LICENSE

MIT

Keywords

FAQs

Package last updated on 17 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc