coryhouse / coryhouse/react-restaurant-scriptpro
Create useLocalStorage generic hook
Open
enhancement
phase-5-cart
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Goal
Build a generic `useLocalStorage(key, initial)` hook that reads/writes JSON to `localStorage` and stays in sync with React state.
## Acceptance criteria
- [ ] Hook signature `useLocalStorage(key, initial): [T, Dispatch>]`
- [ ] Initial read from `localStorage`; falls back to `initial` if missing or invalid
- [ ] Updates persist on every state change
- [ ] Type-safe — no `any`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.