Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Angular ngrx component store .select method

I am trying to find the .select method of ngrx but I cannot really find details on it on internet. What I need is to find out about the overloads of this .select() method. Like, the simplest form is

.select(state => state.someSlice)

But I saw also

.select(p1, p2, (p1, p2) => someFunction(p1, p2));

and similar. Is p1, p2 necessarily an observables? I need some documentation on this. Thanks for any help. Downvotes too. This is the ngrx version that is in my package.json:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

"@ngrx/component-store": "^10.0.0",

>Solution :

the documentation isn’t great on this, but the difference is in v1 you’re just selecting some property of the state with a standard map function.

but in the second, you’re feeding two selectors and the third argument is a map function to combine the result of those two selectors.

select docs are here: https://v10.ngrx.io/api/store/select

but the more useful docs are here: https://v10.ngrx.io/guide/component-store/read

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading