Package Exports
- special-hooks
- special-hooks/dist/index.es.js
- special-hooks/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (special-hooks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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.