1.0.1 • Published 1 year ago

fasunle-react-utils v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

React Utils

This library provides a set of utility functions for working with React components and hooks.

Installation

npm install Fasunle/react-utils

Usage

useDebounce

The useDebounce hook is a utility for debouncing a value. It takes two arguments:

  1. value: The value to debounce.
  2. delay (optional): The delay in milliseconds. Defaults to 200.

Example:

import { useHashRoute } from 'Fasunle/react-utils';

const { hash, changeHash } = useHashRoute();

Register it to a click event or any other trigger as follow:

<button onClick={() => changeHash('/settings')}>Settings</button>
1.0.1

1 year ago

1.0.0

1 year ago