TypeScript · medium
The home dashboard currently loads user then prefs in series. But fetchUser resolves only after the preferences request has started, so waiting for one before starting the other deadlocks the page.
Start both requests without deadlocking, then return the matching user and theme. loadHome(1) resolves to { user: "Ada", theme: "dark" }, and every other id returns its own name.
workspace/
└── src/
└── dashboard.ts (awaits A before starting B; A refuses)With sharpen installed, this command opens exactly this challenge in your local arena:
sharpen 30
First time? The full install is right below.
npm install -g @juanwmedia/sharpen sharpen 30 npx @juanwmedia/sharpen 30 sharpen update