AI AGENT ADDONS

Data Fetching

lobehub/lobehub
Backend & APIs
812installs

When building apps that fetch data, you need a clear plan. This guide shows a three layer approach using a Service Layer, a Zustand Store, and SWR hooks. It helps teams handle API calls, cache results, and update state without messy code.

Developers can stop using useEffect for data loading. Instead they call store hooks like useFetchXxx and get data automatically. The service layer keeps API logic separate and reusable. This makes apps faster and easier to maintain.

If you are moving from old patterns or starting a new feature, this architecture saves time. It works well with any backend that uses a TRPC client. The rules and examples show exactly what to do and what to avoid.

Add Data Fetching skill to your workflow

Global

mkdir -p ~/.claude/skills/data-fetching

Project

mkdir -p .claude/skills/data-fetching

Source Repository

Stars
79,190
Forks
15,490
Watchers
79,190
License
NOASSERTION
Last Push
23 days ago
Created
3 years ago