0

You can get data from redux store using the redux toolkit hook useQueryState
https://redux-toolkit.js.org/rtk-query/api/created-api/hooks#usequerystate

const useQueryStateResult = api.endpoints.getPosts.useQueryState(arg, options)

this property .useQueryState exists only for queries, what to use if we want to know the result of mutation later on?

Akshay Vijay Jain
  • 13,461
  • 8
  • 60
  • 73
  • Didnt try before but seems like you can use the params of `useMutation` to use the result of the mutation across your app: https://github.com/reduxjs/redux-toolkit/pull/1477 – Rashomon Jun 14 '22 at 10:31

0 Answers0