Overview
TheComponentState interface defines the structure for managing the state of components in the Tareas application. It tracks active tabs, user progress, loading states, and processed quest data.
TypeScript Interface
Fields
Identifier for the currently active tab in the component. Used for tab navigation and displaying the appropriate content.
The user’s current experience points (XP) accumulated from completed quests. This value is used to track user progress and level advancement.
Loading state indicator. When
true, the component is fetching or processing data. When false, data loading is complete.Array of Quest objects that have been processed and are ready for display. This includes quests with computed properties like progress, timeLeft, and status.
Usage
TheComponentState interface is typically used in Angular components to maintain and manage UI state. It centralizes key state variables that affect the component’s rendering and behavior.
Common Use Cases
- Tab Management: Track which tab is currently active in multi-tab interfaces
- User Progress: Display user XP and level information
- Loading States: Show loading indicators while data is being fetched
- Quest Display: Store and render processed quest data
Usage Example
State Management Pattern
Related
- Quest Model - The Quest interface used in processedQuests array