vocdoni / ui-components

Vocdoni UI components libs
GNU General Public License v3.0
3 stars 2 forks source link

Add react-query and use it for common fetch methods #186

Open elboletaire opened 2 months ago

elboletaire commented 2 months ago

Creating the new explorer I've realized having some kind of cache in the fetching methods (like fetch election) would reduce a lot the api calls, giving a better user experience too, since it does not need to refetch already fetched info.

At least the fetch election method should be considered to be added as a react query, but others like the fetch census could be considered as well (with lots of keys in the query key to ensure it properly clears cache on any change).