Open JanStevens opened 1 year ago
Is this discussion still open?
@JanStevens did you end up using this in any of your work? I'm currently having issues with query function return values if they return a promise. Looks like TS doesn't like something about GenericFunction<any>
.
Hi,
Typically we use react-query in the following way, by writing a small reusable hook, ex:
This allows us to easily expose what we need from useQuery while allowing to reuse
useEvents
across our application. I've used 2 helper types to extract thevariables
and queryoptions
from the QueryKey factory instance.They could use some love but I think it might be a great addition to this library, also potentially solving issue #40 without making the typings less strict.
Right now it always assumes the Keys are a function, I couldn't really manage to wrap my head around the different options like passing
null
or returning a stringWDYT?