contiamo / restful-react

A consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥
MIT License
1.87k stars 109 forks source link

Allow fetchData in useGet to return data (so refetch can return data) #376

Closed amacleay-cohere closed 2 years ago

amacleay-cohere commented 2 years ago

Why

Attempts to solve #268 by following the non-suggested path: muddle the useGet API by allowing refetch to return the data it just fetched, rather than making the caller put their code in an ambient useEffect

I've explained the thinking somewhat more fully in https://github.com/contiamo/restful-react/issues/268#issuecomment-930620247

netlify[bot] commented 2 years ago

👷 Deploy request for restful-react accepted.

🔨 Explore the source changes: 1fbb384ba2f3cdfa701cb3a81130abe362c41ac2

🔍 Inspect the deploy log: https://app.netlify.com/sites/restful-react/deploys/6154f1a6aacf2b000765313b

fabien0102 commented 2 years ago

@micha-f can you have a look?