resource-api

Create promise-based Angular Resource APIs for async data loading.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/satish-krishna/sigil --skill resource-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resource-api
Source: https://github.com/satish-krishna/sigil/tree/main/.claude/skills/resource-api
Command: npx skills add https://github.com/satish-krishna/sigil --skill resource-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The Skill provides a promise-based data layer for Angular that eliminates RxJS and centralizes async data fetching with resource(), enabling automatic refetch, loading and error state handling, and easy state management.

Core Features & Use Cases

  • Promise-based resource() API for automatic data loading and a single source of truth.
  • Support for loading, value, and error states with safe guards (isLoading, hasValue, hasError).
  • Reactive parameters via a params function and signals to trigger refetch.
  • Tools for testing with HttpClientTestingModule and mock data scenarios.

Quick Start

Create an Angular service that uses resource() to fetch data with a default value and exposes a reload() to refresh.

Frequently Asked Questions about resource-api

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

FAQPage Schema
How do I handle async data loading in Angular without using RxJS?

Async data loading in Angular can be handled using a promise-based Resource API to centralize fetching, automatically refetch when parameters change, and manage loading and error states without RxJS.

What is the best way to manage loading and error states for HTTP requests in Angular?

Managing loading and error states for HTTP requests is best achieved using a promise-based resource pattern with built-in state guards like isLoading, hasValue, and hasError to safely handle UI updates.

How do I automatically refetch Angular HttpClient data when input parameters change?

To automatically refetch Angular HttpClient data, you can use a resource API with reactive parameters via a params function and signals, which triggers data refetch whenever inputs update.

Can I test Angular promise-based resources with mock data scenarios?

Yes, you can test Angular promise-based resources by applying testing tools utilizing HttpClientTestingModule to mock data scenarios and verify resource loading behavior.

Does the Angular resource API support a default value while fetching data?

Yes, the Angular resource API supports a loader-based resource pattern with a defaultValue, ensuring your components have initial data to render before the async fetch completes.

How do I manually refresh or reload async data in Angular components?

To manually refresh async data in Angular components, the resource API exposes a reload() method that triggers a manual refresh of the promise-based data fetch.