New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@hmans/use-version

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hmans/use-version

A hook providing a version number, and a function to increment it.

latest
npmnpm
Version
0.0.2
Version published
Weekly downloads
351
-58.36%
Maintainers
1
Weekly downloads
 
Created
Source

@hmans/use-version

Summary

useVersion provides a numerical version number as well as a function that will bump it up by one. This is a simple mechanism for writing components that need to re-render on specific occasions, and have side effects that need to react to the version number increasing.

import { useVersion } from "@hmans/use-version"

const MyComponent = () => {
  const [version, bump] = useVersion()

  useEffect(() => {
    console.log("Someone bumped the version to", version)
  }, [version])

  return (
    <div>
      <p>Version: {version}</p>
      <button onClick={bump}>Bump</button>
    </div>
  )
}

FAQs

Package last updated on 18 Aug 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