platform icon indicating copy to clipboard operation
platform copied to clipboard

@ngrx/component-store: Clarify "additional selectors" portion of diagram under "File Structure"

Open Madgvox opened this issue 3 years ago • 0 comments

Information

The documentation has a diagram and text description indicating that you can define "additional selectors" in other files by creating a "ComponentStore<object> that won't be managing state and would contain a number of selectors".

What does this look like in practice? My use case is a sub-component that wants to select for a portion of the overall store, but I'd like for that sub-component to own its selectors so I don't have to pollute the root store class. This portion of the documentation seems like it is what I want, but I am having trouble picturing a reasonable implementation of this, and I can't find any further information on this point elsewhere in the docs. It would be nice to have some sample code to illustrate this point.

Documentation page

https://ngrx.io/guide/component-store/comparison

Madgvox avatar Apr 27 '22 00:04 Madgvox