gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
10 stars 6 forks source link

Refactor useQuery to allow setting when data state is kept/reset #177

Closed MortenHofft closed 3 years ago

MortenHofft commented 3 years ago

Currently we have a fixed setting on the useQuery hook keepDataWhileLoading that defines if the data is kept while fetching new data. But this is set at hook initialisation. It can be useful to control this on a per request level.

Instead of having it as part of the initial options, this should be moved to a param on the load function. And all places using the hook should be refactored to use this approach instead.

MortenHofft commented 3 years ago

closed by https://github.com/gbif/gbif-web/commit/72503f1e3b6921efa225c0274de997824d635951 https://github.com/gbif/gbif-web/commit/018381a7d35d6d1d273ae96a2a97f773564a316a https://github.com/gbif/gbif-web/commit/46f58e9510b13826d16d07e5713164205e0f0853