zerojin
v0.2.0
Published
A collection of React hooks and components for modern web applications
Maintainers
Readme
zerojin
A collection of React hooks and components for modern web applications.
Features
- 🚀 Advanced Debounce & Throttle - Leading/trailing options, cancel/flush methods
- 📦 Zero Dependencies - Lightweight and tree-shakeable
- 🔒 Type-Safe - Perfect TypeScript support with full type inference
- 🛠️ Production Ready - Battle-tested patterns for real-world applications
Documentation
Quick links:
Installation
npm install zerojinQuick Example
import { useDebounce } from 'zerojin';
function SearchInput() {
const handleSearch = useDebounce((query: string) => {
console.log('Searching:', query);
// Call your API
}, 500);
return (
<input
onChange={(e) => handleSearch(e.target.value)}
placeholder="Type to search..."
/>
);
}Available Hooks
useDebounce- Delay execution until after inactivityuseThrottle- Limit execution to once per period
Requirements
- React >= 18.0.0
- TypeScript >= 5.0.0 (recommended)
Development
# Install dependencies
npm install
# Build the library
npm run build
# Watch mode for development
npm run dev
# Type checking
npm run type-checkLicense
MIT
