Key for fetchers exposed and way to set it #4824
davidsoderberg
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, to begin with I love ❤️ Remix and have used it for a few different projects now 😄
In my latest project I forced my self to not use react-query and start using fetchers instead and it works out great...
One thing that I have been thinking about is that it would be great to be able to identify another fetcher in another part of the code.
I did see that internally we use a map with a key that today is only an int and for
useSubmitImpl
Remix allows the developer to set that key.My proposal is that
useFetcher
allows to provide a key as well and if the key exists in the map it returns that instance and otherwise a new one is created. It would also be create if the key was included in returned array fromuseFetchers
.What do you think? Is there any reason why this is not implemented already?
Beta Was this translation helpful? Give feedback.
All reactions