Skip to content

Manual Cache Update | Dispatch function is not firing #2569

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

You must be logged in to vote

Assuming you are calling that query without an arugment, it's undefined not null.

            mainApi.util.updateQueryData('getLoggedInUser', undefined, (draft) => {
              console.log('METHOD DISPATCH RAN!!');
              Object.assign(draft, $USER);
            })

and it will only update that data if it already was in cache.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@samislam
Comment options

@samislam
Comment options

@phryneas
Comment options

Answer selected by samislam
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