Closed seanlaff closed 4 years ago
Indeed, nice catch, do you want to take care of this?
Sure, although I have a little concern over what this means for users that have built against the old behavior. If I follow the example of resolve
, folks will need to be very cognizant of memoizing the requestOptions
func. Does that sound ok @fabien0102 ?
Sounds good, and don't worry for compatibilty, I don't mind bumping the major version if it's to improve the library (and stay safe about versionning) 😉
For the memoization, I don't have better solution, but if you are working with react and hooks, this little useMemo
is quite a mandatory knowledge at some point 😁
Sounds good!
We use
requestOptions
to set headers for authorization and tenancy info, but refetches do not get triggered whenrequestOptions
changes, leading to stale state.There is no check for comparing the previous vs new
requestOptions
like there is forresolve
. https://github.com/contiamo/restful-react/blob/61604ee50626b3c910224225cf4dd92cf4b260b0/src/Get.tsx#L191-L205