🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

hookbase

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hookbase - npm Package Compare versions

Comparing version
0.1.8
to
0.1.9
+67
README.md
# 📦 React Reusable Hooks
A collection of reusable React hooks to simplify state management, side effects, and common UI patterns in your projects.
---
## 🚀 Installation
```bash
npx hookbase
```
---
## 📖 Usage
Import the hooks you need directly from the package:
```tsx
import { useBoolean } from "@/hooks/use-boolean";
function App() {
const { value, toggle } = useBoolean();
return (
<div>
<button onClick={toggle}>Toggle</button>
{value && <div>Value is true</div>}
</div>
);
}
```
---
## 🛠️ Available Hooks
useBoolean
useCopyToClipboard
useDocumentTitle
useInterval
useIsomorphicLayoutEffect
useTimeout
useToggle
useUnmount
useCounter
useMousePosition
Here are some of the included hooks (expand as needed):
- `useDebounce(value, delay)` → Debounces a value by the given delay.
- `useLocalStorage(key, initialValue)` → Persist state in localStorage.
- `usePrevious(value)` → Get the previous value of a state or prop.
- `useOnClickOutside(ref, handler)` → Detect clicks outside of a given element.
- `useFetch(url, options)` → Simplify data fetching with built-in loading and error states.
---
## 📜 License
This project is licensed under the [MIT License](./LICENSE).
---
## Documentation
Coming soon
+1
-1
{
"name": "hookbase",
"version": "0.1.8",
"version": "0.1.9",
"type": "module",

@@ -5,0 +5,0 @@ "bin": {

# 📦 React Reusable Hooks
A collection of reusable React hooks to simplify state management, side effects, and common UI patterns in your projects.
---
## 🚀 Installation
```bash
npx hookbase
```
---
## 📖 Usage
Import the hooks you need directly from the package:
```tsx
import { useBoolean } from "@/hooks/use-boolean";
function App() {
const { value, toggle } = useBoolean();
return (
<div>
<button onClick={toggle}>Toggle</button>
{value && <div>Value is true</div>}
</div>
);
}
```
---
## 🛠️ Available Hooks
useBoolean
useCopyToClipboard
useDocumentTitle
useInterval
useIsomorphicLayoutEffect
useTimeout
useToggle
useUnmount
useCounter
useMousePosition
Here are some of the included hooks (expand as needed):
- `useDebounce(value, delay)` → Debounces a value by the given delay.
- `useLocalStorage(key, initialValue)` → Persist state in localStorage.
- `usePrevious(value)` → Get the previous value of a state or prop.
- `useOnClickOutside(ref, handler)` → Detect clicks outside of a given element.
- `useFetch(url, options)` → Simplify data fetching with built-in loading and error states.
---
## 📜 License
This project is licensed under the [MIT License](./LICENSE).
---
## Documentation
Coming soon