1.0.2 • Published 1 year ago

@arshazar/react-custom-hooks v1.0.2

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

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();
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.2

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago