Skip to content

How to invalidate previous page cache key on pagination in RTK query.. #2939

@panda919

Description

@panda919

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions