You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I love the getData and useResource pattern, the DX would be really nice for straight fetching data.
Relay doesn't set up its API in a way that would work nicely with this approach. It has two main functions:
// In your routesconstqueryRef=loadQuery(/* ... */);// In your componentconst{ data }=usePreloadedQuery(queryRef,/*... */);
Instead of using a promise to figure out if the fetch is complete, it uses a reference that acts as a handle on the request. This would work okay (if a bit strange) with getData and useResource, I could just ignore the loading and error statuses. Except that the queryRef needs to be actively disposed when it is no longer displayed.
Potentially a solution would be to add a more customisable get and dispose combo of options to the router config.
The text was updated successfully, but these errors were encountered:
Hi, I love the
getData
anduseResource
pattern, the DX would be really nice for straight fetching data.Relay doesn't set up its API in a way that would work nicely with this approach. It has two main functions:
Instead of using a promise to figure out if the fetch is complete, it uses a reference that acts as a handle on the request. This would work okay (if a bit strange) with
getData
anduseResource
, I could just ignore the loading and error statuses. Except that thequeryRef
needs to be actively disposed when it is no longer displayed.Potentially a solution would be to add a more customisable
get
anddispose
combo of options to the router config.The text was updated successfully, but these errors were encountered: