data-fetching-architecture

Implement a structured data-fetching pipeline for React with Zustand and SWR.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/alceupassos/hub --skill data-fetching-architecture-alceupassos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-fetching-architecture
Source: https://github.com/alceupassos/hub/tree/main/.agents/skills/data-fetching-architecture
Command: npx skills add https://github.com/alceupassos/hub --skill data-fetching-architecture-alceupassos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires zustand, swr, lambdaClient, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the common challenges of data fetching in modern applications, providing a structured approach to streamline the process and improve efficiency.

Core Features & Use Cases

  • Service Layer Integration: Encapsulates API calls for a clean, typed interface.
  • Store with SWR Hooks: Manages client-side state and provides efficient data fetching.
  • Component Usage: Demonstrates best practices for component-level data handling.
  • Common Patterns: Offers guidance on pagination, dependent fetching, conditional fetching, and cross-domain refresh.
  • Migration Guide: Assists in migrating from useEffect to Store SWR for improved performance and maintainability.
  • Use Case: Ideal for developers seeking to implement a robust data-fetching architecture in React applications using Zustand and SWR.

Quick Start

Use the data-fetching-architecture skill to implement a structured data-fetching pipeline in your application.

Frequently Asked Questions about data-fetching-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure data fetching in React using Zustand and SWR?

To structure data fetching in React, encapsulate API calls in a service layer, manage client state with Zustand, and handle component-level data with SWR hooks. This pipeline provides a clean interface for efficient data workflows.

How do I migrate React data fetching from useEffect to SWR?

Migrate React data fetching from useEffect to SWR by replacing manual effect logic with Store SWR hooks. This migration improves performance and maintainability by leveraging built-in caching and cross-domain refresh patterns.

What is the best way to manage API integration state in React with Zustand?

The best way to manage API integration state is using a structured store with SWR hooks. This approach handles component-level data fetching efficiently while maintaining a typed service layer for API interactions.

Do I need a lambdaClient to use SWR for data fetching in React?

Yes, you need a lambdaClient for API interactions when using this data fetching architecture. It works alongside SWR and Zustand to execute the actual API calls defined within your service layer.

Does this data fetching architecture support pagination and conditional fetching?

Yes, this data fetching architecture supports pagination, conditional fetching, and dependent fetching. It provides structured patterns within the Zustand and SWR pipeline to handle these common component-level data requirements.