Angular Suite Module state management¶
This document aims to provide guidelines as how to structure your state slices, actions, reducers and etc, as well as provide answers to some frequently asked questions. It draws inspiration from recommendations made by the NGRX Team, Good Action Hygiene, the Redux Style Guide and some in house recommendations from the Suite Team.
Notice
This section is under construction
Resources¶
- Redux style guide: Yes, we are not using pure redux, but some if not most of the best practices defined by the Redux community will apply to any redux-based solution.
- Good Action Hygiene
- Ngrx: Patterns and techniques
Wiki NGRX section¶
- Runtime checks must be enabled.
strictActionImmutability
,strictStateImmutability
,strictStateSerializability
,strictActionSerializability
- Action types must contain application namespace in PascalCase (i.e: 'iinspector/Create inspection', 'Core/Token obtained')
- Action types must be sentence case (i.e: "iinspector/Create inspections continues in lowercase")
- Feature Keys must be lowercase, app prefixed and pascalCase. (i.e: 'coreAuth', 'iinspectorTemplate')
Actions¶
- Actions should be unique in the source/event they are describing.
- Actions have a unique dispatch point, and are not reused.
- Actions should live close to the place they are dispatched from.
- Actions should capture events, not commands nor represent functions.