explicit-state-management

Community

Clear loading, error, and empty UI states

Authorandresdiegolanda
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Components that load data over HTTP often intermix loading indicators, error messages, and empty results, producing flaky or inconsistent UI behavior. This pattern makes those states explicit and predictable so the component renders the correct view for loading, failure, empty results, and successful data loads.

Core Features & Use Cases

  • Explicit local state: a typed items array, a loading boolean, and an error string|null that are set deterministically at the start and end of each load.
  • Mutually exclusive template blocks that show a loading indicator, a user-facing error with a Retry button, an empty-state message, or the populated list.
  • Simple retry pattern and clear rules: set loading=true and error=null when starting a load, set loading=false on both success and failure, and never expose technical error details to users.
  • Use case: an Angular user-search or item-list component that must surface transient network errors and an empty-result state without relying on async pipe.

Quick Start

Convert the target Angular component to use three explicit state properties (items, loading, error), set loading=true and error=null at load start, set loading=false on completion, and render mutually exclusive template blocks for loading, error (with Retry), empty, and populated states.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: explicit-state-management
Download link: https://github.com/andresdiegolanda/design-first-ai/archive/main.zip#explicit-state-management

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.