Skip to content
Discussion options

You must be logged in to vote

The cache doesn’t store the fetcher, it’s only a map (literally a Map) of key:data, if you use the same key with different fetchers only the last one will be stored in the cache.

If the data is different then the key must be different, the key is the id of the data, what i recommend you to do is to create hooks like useA, useB, etc. And keep a key and a fetcher, this way you only call those hooks and can be sure both key and fetcher are always the same.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Jack-Works
Comment options

@sergiodxa
Comment options

@Jack-Works
Comment options

@dangoldstein
Comment options

@colmanhumphrey
Comment options

Answer selected by Jack-Works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants