Angular Best Practices Signalstore

alfredoperez/angular-best-practices/skills/angular-best-practices-signalstore

作者 alfredopereza499a4786182097a500dd2fb6ddc2489caee3854MIT37 个星标收录于 2026年10月9日更新于 2026年10月9日仓库6个月前更新

NgRx SignalStore best practices for Angular. Covers shared state, computed state, entity management, and RxJS integration with rxMethod. Activates when working with @ngrx/signals and @ngrx/signals/entities. Do not use for NgRx Store or class-based state services. Install alongside angular-best-practices for full coverage.

已归档仅含说明Software Development
AI 生成的概览

面向 Angular 的 NgRx SignalStore 最佳实践指南,涵盖共享状态、计算状态、实体管理与 RxJS 集成。

功能
该技能提供在 Angular 应用中使用 NgRx SignalStore 的最佳实践规则。内容涵盖基于信号的共享状态、通过 withComputed 派生的状态、使用 withEntities 管理集合,以及通过 rxMethod 集成 RxJS 副作用。它是仅含说明的附加技能,需与核心 Angular 最佳实践技能一同安装。
适用场景
适用于创建或修改基于 SignalStore 的状态管理、使用 rxMethod 集成 RxJS 副作用,或使用 withEntities 管理集合的场景。不适用于 NgRx Store 或基于类的状态服务。
运行要求
无需脚本或工具,仅为说明性技能文档。假定项目为使用 @ngrx/signals 与 @ngrx/signals/entities 的 Angular 项目,并设计为与核心 angular-best-practices 技能一同安装。

Angular SignalStore Best Practices

NgRx SignalStore rules for signal-based local and feature state management. Use with the core angular-best-practices skill for comprehensive Angular coverage.

Links

When to Apply

  • Creating or modifying SignalStore-based state management
  • Integrating RxJS side effects with rxMethod
  • Managing collections with withEntities

Rules

RuleImpactDescription
Use rxMethod for RxJS IntegrationMEDIUMDebounce, switchMap, and other RxJS operators in stores
Use SignalStore for Shared StateHIGHSignal-based reactivity without full NgRx overhead
Use withComputed for Derived StateMEDIUMCentralized memoized derivation logic
Use withEntities for CollectionsMEDIUMO(1) lookups and standardized CRUD operations

Install

Install from skills.sh/alfredoperez/angular-best-practices:

来源与署名

来源:alfredoperez/angular-best-practices位于skills/angular-best-practices-signalstore提交a499a47

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架