@arshazar/react-custom-hooks
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

React Custom Hooks

Custom hooks for React to make life easy!

Installation

You can easily install React Custom Hooks by yarn, npm or pnpm.

yarn

yarn add @arshazar/react-custom-hooks

npm

npm i @arshazar/react-custom-hooks

pnpm

pnpm add @arshazar/react-custom-hooks

Table of Hooks

useUpdate

usage: useUpdate(callback, [dependencies])

import { useUpdate } from "@arshazar/react-custom-hooks";

useUpdate(() => {
  setSource(images);
}, [images]);

useDebounce

usage: useDebounce(value, delay, callback)

import { useDebounce } from "@arshazar/react-custom-hooks";

const debounceValue = useDebounce(value, 1, handleChangeColor);

useTimeout

usage: useTimeout(callback, delay)

import { useTimeout } from "@arshazar/react-custom-hooks";

useTimeout(handleFadeAnimation, 200);

useThrottle

usage: useThrottle(callback, period, delay)

import { useThrottle } from "@arshazar/react-custom-hooks";

useThrottle(handleChangeCover, 5000, 10);

useMobile

usage: useMobile(smallDevicesOnly = false)

import { useMobile } from "@arshazar/react-custom-hooks";

const isMobile = useMobile();

useInterval

usage: useInterval(callback, delay)

import { useInterval } from "@arshazar/react-custom-hooks";

useInterval(handleScrollAnimation, 150);

useCursorPosition

usage: useCursorPosition()

import { useCursorPosition } from "@arshazar/react-custom-hooks";

const cursorPosition = useCursorPosition();

Readme

Keywords

Package Sidebar

Install

npm i @arshazar/react-custom-hooks

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

15.5 kB

Total Files

31

Last publish

Collaborators

  • arshazar