react-hothook
v1.1.2
Published
Outstanding set of React hooks
Readme
Hooks
useAsync— provides a functionality for async functionsuseCached— saves only not empty, not undefined and not null valuesuseCountdown— manages a customizable countdown timer with lifecycle events, including pause, resume, reset, and update capabilitiesuseDebouncedCallback— provides debounced modification for default react's useCallbackuseDebouncedValue— debounces a value, updating it only after a specified delay to optimize performance and prevent frequent updatesuseDeepCompareEffect— runs an effect only when the dependencies change based on a deep comparison using lodash's isEqual function, avoiding unnecessary executions caused by shallow comparison of complex objects or arraysuseFetch— simplifies data fetching by combining the Fetch API with the useAsync hook, providing reactive state management for data, error, and isLoadinguseMount— runs a function only once when the component mounts, providing a cleaner abstraction for lifecycle setup logicusePrevious— tracks and retrieves the previous state or prop value, with an option to ignore specific values during updatesuseSpecificKeyExtractor— creates a customizable and memoized key extractor function for React list mapping, ensuring unique and stable keys based on a specified field and optional prefixuseStateWithCached— extends React's useState to include a cached non-empty stateuseStateWithPrevious— extends React's useState to include the previous state valueuseStateWithValidation— extends React's useState with a validator function to track the validity of the stateuseToggle— manages boolean state with a built-in toggle functionuseUpdateEffect— acts like useEffect but skips execution on the initial render
