Skip to content

State transformation that relies on other global state. #1232

Answered by phryneas
tomascsantos asked this question in Q&A
Discussion options

You must be logged in to vote

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 )

const selector = createSelector(
  api.endpoints.getUser.select(),
  api.endpoints.getGroups.select(),
  (user, groups) => {
    return ...
  }
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tomascsantos
Comment options

Answer selected by tomascsantos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants