1 async function fetchUser(id: string) {
2+ if (cache.has(id)) return cache.get(id)
3+ const res = await fetch(`/api/user/${id}`)
4 }
5
6+const cache = new Map<string, unknown>()
7
8 // cache hit avoids redundant fetches
9 export default { fetchUser, cache }