Angular Best Practices Ngrx

alfredoperez/angular-best-practices/skills/angular-best-practices-ngrx

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

NgRx state management best practices for Angular. Covers pure reducers, action groups, entity adapter, selectors, and signal-based selection. Activates when working with @ngrx/store, @ngrx/effects, and @ngrx/entity. Do not use for Akita, NGXS, or standalone signal-based state. Install alongside angular-best-practices for full coverage.

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

Angular 的 NgRx 状态管理最佳实践,涵盖 reducer、effect、selector 与实体适配器。

功能
为 Angular 项目中的 NgRx 状态管理提供规则指导,涵盖纯 reducer、action 分组、实体适配器、selector 以及基于 signal 的选择。它是配套技能,需与核心 Angular 最佳实践技能一起使用。产出的是建议性规则,而非代码产物。
适用场景
适用于新增或修改 NgRx store、reducer 或 effect,编写用于组件状态选择的 selector,或使用 @ngrx/entity 管理集合时。不适用于 Akita、NGXS 或独立的基于 signal 的状态。
运行要求
无需脚本或运行时依赖,仅为指令型技能。假定项目使用 @ngrx/store、@ngrx/effects 和 @ngrx/entity,并设计为与核心 angular-best-practices 技能一同安装。

Angular NgRx Best Practices

NgRx state management rules for global state with actions, reducers, effects, and selectors. Use with the core angular-best-practices skill for comprehensive Angular coverage.

Links

When to Apply

  • Adding or modifying NgRx stores, reducers, or effects
  • Writing selectors for state selection in components
  • Managing collections with @ngrx/entity

Rules

RuleImpactDescription
Keep Reducers PureHIGHNo side effects in reducers; move HTTP calls to Effects
Use Feature SelectorsMEDIUMMemoized selectors that recompute only when inputs change

Install

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

来源与署名

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

许可证: MIT

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

举报或申请下架