0.5.0 • Published 10 months ago

special-hooks v0.5.0

Weekly downloads
-
License
Apache
Repository
github
Last release
10 months ago

Special Hooks

This project was made to provide some easy and special hooks for hassle-free development.

Available Hooks

useCardType - This hook is used to get the card type of a card.

const [cardType, errors] = useCardType(cardNumber);

useValidateEmail - This hook is used to get the card type of a card.

const isValid = useValidateEmail(email);

useRandomEmails - This hook generates random emails.

const emails = useRandomEmails(count);

useRandomColors - This hook is made to generate random colors.

const colors = useRandomColors(count);

useCounter - This provides a counter object to be used in a component.

const {count, increment, decrement} = useCount(initialCount);

useDateTime - It provides current date and time in a array.

const [date, time] = useDateTime();

useCopyToClipboard - It returns the copied boolean state and handleCopy method to save text to clipboard

const [copied, handleCopy] = useCopyToClipboard();

useHorizontalOverflow - It returns the boolean for the overflow condition in a container taking ref as input.

const [copied, handleCopy] = useHorizontalOverfow(ref, callback?);

useVerticalOverflow - It returns the boolean for the overflow condition in a container taking ref as input.

const [copied, handleCopy] = useVerticalOverflow(ref, callback?);

useTheme - It returns the theme and its toggle function to handle dark and light mode.

const {theme, toggleTheme} = useTheme();

useDebounce - It returns the debounced value after a certain delay period.

const debouncedValue = useDebounce(value, delay);

useFetch - It returns the loading, data and error for the url through a http request.

const {loading, data, error} = useFetch(url);

Contribution Guide

Feel free to contribute to the codebase.

0.5.0

10 months ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago