uno-mvux-liststate

Manage mutable reactive lists with ListState<T> in MVUX apps.

9|1|Updated Dec 10, 2024
One-click install
npx skills add https://github.com/unoplatform/studio --skill uno-mvux-liststate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uno-mvux-liststate
Source: https://github.com/unoplatform/studio/tree/main/plugins/uno-platform-studio/skills/uno-mvux-liststate
Command: npx skills add https://github.com/unoplatform/studio --skill uno-mvux-liststate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MVUX ListState provides a mutable, reactive collection primitive for MVUX apps, enabling reliable stateful list manipulation and selection in UI-driven scenarios.

Core Features & Use Cases

  • Create ListState<T> with ListState.Empty(this) for empty lists or ListState.Async(this, asyncFunc) to load data asynchronously.
  • Mutate lists with AddAsync, RemoveAllAsync, UpdateAsync, and InsertAsync, with optional .Selection(state) for item selection tracking.
  • Ensure items implement key equality (IKeyEquatable<T>) for correct identity and stable updates, supporting two-way binding with MVUX patterns and messaging.
  • Use MVUX ListState to synchronize with ListFeed, State, and messaging patterns in MVUX apps.

Quick Start

Instantiate a ListState<T> and perform initial mutations to seed and update your list.

Frequently Asked Questions about uno-mvux-liststate

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

FAQPage Schema
How do I manage mutable reactive lists in MVUX apps?

Manage mutable reactive lists in MVUX apps using ListState<T>, which provides an abstraction for adding, removing, updating, and selecting items with two-way binding. It synchronizes UI and services via ListFeed and messaging.

How do I initialize a ListState and load data asynchronously in MVUX?

Initialize ListState using ListState.Empty(this) for empty collections or ListState.Async(this, asyncFunc) to load data asynchronously. You then apply mutations using AddAsync, RemoveAllAsync, UpdateAsync, and InsertAsync with pure updater functions.

Do I need IKeyEquatable<T> to update items in an MVUX ListState?

Yes, items must implement IKeyEquatable<T> to ensure correct identity and stable updates within ListState. This key equality requirement allows reliable tracking when synchronizing lists across UI and services.

Can I track item selection when mutating an MVUX ListState?

Track item selection during ListState mutations by chaining .Selection(state) to your mutation methods. This supports stateful selection tracking alongside adding, removing, and updating items in reactive MVUX views.

What's the best way to synchronize lists across UI and services in MVUX?

Synchronize lists across UI and services by combining ListState<T> with ListFeed, State, and messaging patterns. This approach reflects changes from asynchronous data sources and supports reliable two-way binding in MVUX applications.