1

I completed inflating the pagination engine for react native flat list with the RTK query. API pagination param is {offset: number, pageSize: number}.

For example, I fetched with "offset:100, pageSize:10", then current fetch API is cache key is "offset:100, pageSize:10"

Now I update or remove one item of previous page (offset 90/pageSize 10).

In this case, if I try invalidate this API with [key:"fetch", id:"list"], this action is trigger "offset:100, pageSize:10" API. I need to refetch "offset:90, pageSize:10" .

Which solution can I help? p.s

or not, is there solution to access/update all previous fetched cache data (offset0 ~ offset 100 )?

for example, in apollo-client(graphQl) we can use cache.modify to update all cache

L.Benrong
  • 81
  • 1
  • 1
  • 4
  • you should provide some code. but I don't know why you need to invalidate the cache in the first place. check this out it may help you. https://redux-toolkit.js.org/rtk-query/usage/cache-behavior#no-normalized-or-de-duplicated-cache – Amir Rezvani Nov 24 '22 at 23:29

0 Answers0