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

@dhmk/hooks

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhmk/hooks

Various React.js hooks

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Var Hooks

Basic

  • usePrevious(x: T): T | undefined - returns a value from previous render.

  • useUpdate(): () => void - like class-based component's forceUpdate.

  • useLatestCallback(fn: T): T - like useCallback, but always calls the latest provided fn (no stale closure).

    Additionally, returned function always has a stable identity, unlike the standard useCallback/useMemo, which may return a new function in some cases as stated in their docs.

    It's safe to omit the function from the useEffect or useCallback dependency list.

  • useGetter(x: T): () => T - returns a function with a stable identity that returns an argument provided to it.

    It's safe to omit the function from the useEffect or useCallback dependency list.

Keywords

FAQs

Package last updated on 01 Apr 2021

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