1.0.5 • Published 11 months ago

use-rev v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

npm version Downloads Uses TypeScript

use-rev

A revision counter React hook.

This hook returns a number (a revision), and a function to increment the revision (the bump function).

  • The revision is guaranteed to always be truthy.
  • If the revision reaches Number.MAX_SAFE_INTEGER, it wraps back to 1.
  • The bump function is memoized with useCallback and will never change.

Usage

import { useRev } from 'use-rev';

// (inside a React component)
const [rev, bumpRev] = useRev();
1.0.5

11 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago