This question is about best practices, and when to use ngrx/store and when not. So I have a project I'm working on, and already using ngrx/store for the state management. I understand what ngrx/state is supposed to solve, but every now and then I came across a case where I'm not sure whether I'm supposed to use ngrx/store or not.
So here is the case: I have two components, one for listing the categories, and another for showing the category details. The category details can display a specific category by implementing either:
A field in the ngrx state,
selectedCateogryId
for example, and whenever it's selected in the first component, it fires an action updating the field in the ngrx state, while the second component is subscribed to theselect
ngrx/storeselectedCateogryId
fieldOr Use a basic
@Input CategoryId
in the second component, and use the attribute in the first component<second-component [category_id]="category.id"></second-component>
My question is what would be the right approach, should I be using ngrx/store for something so simple like this (since I'm already using ngrx/store in the app), or, just use the @Input binding for simple component communication.