However, I'm struggling how to use RTKQuery when I get requirements where I actually need to aggregate/derive some data from ALL the retrieved contacts in the parent component.
Example use case:
Add "average age" to the ContactsList
The imperative version, would look something like this:
Let's say I have a very simple use case where I need to show a list of contacts by hitting this endpoint:
Using RTK query hooks, it would look something like this:
However, I'm struggling how to use RTKQuery when I get requirements where I actually need to aggregate/derive some data from ALL the retrieved contacts in the parent component.
Example use case:
The imperative version, would look something like this:
Any help / direction would be appreciated.