When using state manager with Angular, Does it mean that all component class attributes are selectors ? If no what are the guidlines to decide what to store in the store and what to store in component class attributes ?
When using state manager with Angular, Does it mean that all component class attributes are selectors ? If no what are the guidlines to decide what to store in the store and what to store in component class attributes ?
I would suggest you to have a look at few resources about Smart vs Dumb components. When using state manager you have possibility to apply this architecture very well. Have a look at one of the good articles Smart Components vs Presentational Components. In Angular people are calling them containers vs components.
For quick reference, Do separate components between Presentation Layer and Domain Layer.
Domain Layer components are called containers, which can have access to the state manager. They control how state is managed. Containers pass required data to the presentation components and with the help of event emitters coming from them, containers modify domain state.
Presentation Layer they are simply called components, they are dumb, they don't have access to state manager. All they can have is to get data from containers or other components with the help of Input. Output helps to pass events to the containers so container can modify state. Also dumb components can have their own private state which helps to maintain correct UI state.