State transformation that relies on other global state. #1232
-
Hello and thank you for creating this wonderful toolkit. I am new to Redux and feel a little overwhelmed using RTX Query on top of it, but the functionality it provides is very alluring. Here is my situation: I have created two query endpoints:
My current struggle, is that I am not quite sure how to transform the response from the "api/habits" using global state data from "api/me". I know that there is a
My print statement shows that users is null at the time of the function call. I would not expect this to be the case since in my environment the I think that I might be thinking about all of this the wrong way, but I am not sure how to untangle this mess. Any links, tutorials, etc would be appreciated. Thanks :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Write this as a reselect selector and also use the pre-generated selectors (for more on reselect, read https://redux.js.org/usage/deriving-data-selectors )
|
Beta Was this translation helpful? Give feedback.
state.youdoneApi.queries.getGroups.data
is simply the wrong path ;)Write this as a reselect selector and also use the pre-generated selectors (for more on reselect, read https://redux.js.org/usage/deriving-data-selectors )