cache
Memory memoization cache map.
1.7 KB
•Updated on September 3, 2026
Installation
Bash
pnpm dlx shadcn@latest add @spaceui/hooks-utils-cacheUsage
Code
import { cache } from '@/utils/cache'
const memoized = cache((x: number) => x * 10)API Reference
Parameters / Props
| Parameter | Type | Default | Description |
|---|---|---|---|
fn | Function | required | Computation to memoize. |
Return Value
| Return Type | Description |
|---|---|
Function | Memoized function. |