1

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. This is the ngrx version that is in my package.json:

"@ngrx/component-store": "^10.0.0",
E_net4
  • 27,810
  • 13
  • 101
  • 139
Vladimir Despotovic
  • 3,200
  • 2
  • 30
  • 58

1 Answers1

1

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

bryan60
  • 28,215
  • 4
  • 48
  • 65